Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #399449

    I am trying to do what is explained at this link: https://www.role-editor.com/block-selected-tabs-woocommerce-product-data-metabox/

    But I can not find the custom.js file anywhere. Where should I add this code?

    Thanks!

    #399615

    Hey alex5252!

    Please go to Enfold/js folder via FTP and create a file callled “custom.js” there

    Regards,
    Yigit

    #399677

    Thank you for the reply, I tried to do that but it is not working. I know this code works as I used it in my previous theme.

    #399680

    Hi!

    Have you enqueued the script by adding following code to Functions.php file in Appearance > Editor?

    function enqueue_custom_js() {
    	wp_enqueue_script( 'custom-js', get_template_directory_uri() . '/js/custom.js', array(), '1.0.0', true );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_custom_js' );

    If not, please do so

    Cheers!
    Yigit

    #399682

    I tried with both the child theme and the main theme. No luck.

    #399691

    Hi!

    If you do not mind, can you post a temporary admin login here privately?

    Best regards,
    Yigit

    #399694
    This reply has been marked as private.
    #400013

    Hi!

    Add this to the functions.php:

    add_action('admin_head', 'ava_remove_product_panel');
    function ava_remove_product_panel() {
    ?>
    <script>
    (function($){
    	// remove selected WooCommerce Products Tab
    	$('.general_tab').remove();  // General
    	$('#general_product_data').css('display', 'none');  // hide General tab content as it is visible by default
    	
    	$('.inventory_tab').remove();  // Inventory
    	$('.shipping_tab').remove();  // Shipping
    	$('.linked_product_tab').remove(); // Linked Products
    	$('.attribute_tab').remove();  // Attributes
    	$('.variations_tab').remove();  // Variations
    	$('.advanced_tab').remove();  // Advanced
    })(jQuery);
    </script>
    <?php
    }

    You can follow the solution provided here if you want to disable the panel for specific user roles: https://wordpress.org/support/topic/conditional-display-based-on-role

    Cheers!
    Ismael

    #400087

    Thank you for the reply, I have added the code to my functions.php and still no luck. It is not working. Did it work for you?

    #400543

    Hey!

    Can you post the link to your website please? You have posted admin logins but forgot to post the link

    Best regards,
    Yigit

    #400663
    This reply has been marked as private.
    #401620

    Hi!

    Your using quite a few plugins there which is causing javascript errors.

    Your also using a plugin which is removing the theme editor.

    Go ahead and deactivate them all and then add Ismael’s code to the bottom of Enfolds functions.php file and it should work.

    Cheers!
    Elliott

    #401642

    Hey!

    Please add following code to Functions.php file in wp-content/themes/enfold folder ( Editor does not appear in Appearance tab )

    add_filter('woocommerce_product_data_tabs', 'avia_remove_tabs', 10, 1);
    function avia_remove_tabs( $tabs ) {
        unset( $tabs['linked_product'], $tabs['inventory'], $tabs['shipping'], $tabs['advanced'] );
        return ( $tabs );
    }

    Cheers!
    Yigit

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.