I am using the code coming from this answer:
Hiding tabs only for some products in WooCommerce single product pages
Here is that code:
add_fi
Try below code
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;
//get all categories
$terms = wp_get_post_terms( $product_id, 'product_cat' );
foreach ( $terms as $term )
{
$categories[] = $term->slug;
}
if ( in_array( 'Your-product-categories-slug', $categories ) ) {
unset( $tabs['description'] ); // (Description tab)
unset( $tabs['reviews'] ); // (Reviews tab)
unset( $tabs['additional_information'] ); // (Additional information tab)
}
return $tabs;
}
Edit for check more then 1 categories
For check more then 1 categories used has_term()
$product_cats=array('Your-product-categories-slug1','Your-product-categories-slug2','Your-product-categories-slug3');
if( has_term( $product_cats, 'product_cat', $product_id ) ){
.....
}