Хорошо, я не эксперт по woocommerce, и ни один из них не работал с ним. Тем не менее, зная WordPress и как получить термины работают .. вы можете попробовать что-то вроде следующего.
add_filter( 'woocommerce_product_tabs', 'conditionaly_removing_product_tabs', 99 );
function conditionaly_removing_product_tabs( $tabs ) {
// Get the global product object
global $product;
// Get the current product ID
$product_id = method_exists( $product, 'get_id' ) ? $product->get_id() : $product->id;
// Define HERE your targeted categories (Ids, slugs or names) <=== <=== <===
// $product_cats = array( 'clothing', 'posters' );
// lets get all terms and then programatically exclude certain categories
$terms = get_terms( 'product_cat', array(
'orderby' => 'name',
'order' => 'ASC',
'exclude' => array( 77, 71 ), // dont forget to include ids for the categories
));
// Loop over the tabs and remove them from the categories
array_map(function($term) use ($product_id, $tabs){
if ( has_term($term, 'product_cat', $product_id)){
unset( $tabs['description'] ); // (Description tab)
unset( $tabs['reviews'] ); // (Reviews tab)
unset( $tabs['additional_information'] ); // (Additional information tab)
}
}, $terms);
return $tabs;
}