-
AuthorPosts
-
February 20, 2015 at 6:17 am #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!
February 20, 2015 at 1:55 pm #399615Hey alex5252!
Please go to Enfold/js folder via FTP and create a file callled “custom.js” there
Regards,
YigitFebruary 20, 2015 at 3:10 pm #399677Thank 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.
February 20, 2015 at 3:12 pm #399680Hi!
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!
YigitFebruary 20, 2015 at 3:14 pm #399682I tried with both the child theme and the main theme. No luck.
February 20, 2015 at 3:24 pm #399691Hi!
If you do not mind, can you post a temporary admin login here privately?
Best regards,
YigitFebruary 20, 2015 at 3:26 pm #399694This reply has been marked as private.February 21, 2015 at 10:27 am #400013Hi!
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!
IsmaelFebruary 21, 2015 at 4:39 pm #400087Thank 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?
February 23, 2015 at 11:57 am #400543Hey!
Can you post the link to your website please? You have posted admin logins but forgot to post the link
Best regards,
YigitFebruary 23, 2015 at 2:54 pm #400663This reply has been marked as private.February 24, 2015 at 7:02 pm #401620Hi!
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!
ElliottFebruary 24, 2015 at 7:29 pm #401642Hey!
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 -
AuthorPosts
- You must be logged in to reply to this topic.