• Resolved miinalee

    (@miinalee)


    Hi, I really likes the plugin but I only need “price/general” option to display on my wp-admin editor page. Anyone have any idea where to find the files so I can remove these and leave only “general_product_data”?

    ` <ul class=”product_data_tabs wc-tabs”>
    <li class=”general_options general_tab hide_if_grouped”>
    <span>General</span>

    <li class=”inventory_options inventory_tab show_if_simple show_if_variable show_if_grouped show_if_external”>
    <span>Inventory</span>

    <li class=”shipping_options shipping_tab hide_if_virtual hide_if_grouped hide_if_external”>
    <span>Shipping</span>

    <li class=”linked_product_options linked_product_tab “>
    <span>Linked Products</span>

    <li class=”attribute_options attribute_tab “>
    <span>Attributes</span>

    <li class=”variations_options variations_tab variations_tab show_if_variable”>
    <span>Variations</span>

    <li class=”advanced_options advanced_tab “>
    <span>Advanced</span>

    • This topic was modified 4 years, 10 months ago by miinalee.
Viewing 2 replies - 1 through 2 (of 2 total)
  • class-wc-meta-box-product-data.php is the filename that you are asking for, but it would be a really bad idea to edit it. This is because any edits would be overwritten by the next update.

    Fortunately WooCommerce gives us a filter which we can use to change the default list of tabs. This snippet goes in functions.php for your child theme:

    add_filter( 'woocommerce_product_data_tabs', 'custom_product_data_tabs' ); 
    function custom_product_data_tabs( $tabs ) {
      // unset( $tabs['general'] );
      unset( $tabs['inventory'] );
      unset( $tabs['shipping'] );
      unset( $tabs['linked_product'] );
      unset( $tabs['attribute'] );
      unset( $tabs['variations'] );
      unset( $tabs['advanced'] );
      return $tabs;
    }

    Hey @miinalee !

    You should be able to use the code that @lorro just shared to accomplish this. As they mentioned, it is highly advised to not edit core WooCommerce files because when it updates they will get overwritten.

    You can place the code in the “functions.php” of a child theme, or you can use a plugin like Code Snippets to add and manage them a little more easily. Read more about using Code Snippets here.

    Thanks for you patience I am going to close this issue as resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Removing Product Data Options’ is closed to new replies.