0
votes

I need to remove the below tabs from the product data 1- 'Get more option' Tab 2- 'woocommerce tab' 3- Upsell 4- Cross-sell As shown in the screenshot https://prnt.sc/pp1oyy

I wrote the below function but not working

function remove_tab($tabs){
unset($tabs['get_more_options']); // it is to remove general tab
unset($tabs['woocommerce_tab']); // it is to remove variations tab
return($tabs);
}
add_filter('woocommerce_product_data_tabs', 'remove_tab', 10, 1);
1

1 Answers

0
votes

The "Get more options" suggestions tab were added in Woocommerce 3.6 and you can disable it by either going to Woocommerce -> Settings -> Advanced -> "Woocommerce.com" and untick the checkbox "Show suggestions".

Another way is to add the following code to your themes functions.php:

add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false' );

In terms of the "Woocommerce tab" - if you want to remove upsells & cross sells you can add the follow code:

function remove_tab($tabs){
    unset($tabs['linked_product']); // Removes the tab section for cross & upsells
    return($tabs);
}
add_filter('woocommerce_product_data_tabs', 'remove_tab', 10, 1);