Hi @pedrorito,
What you are looking for seems to be a new functionality that removes product attribute terms from the “Additional information tab” implicitly, if they have a product tab description set. Is that correct?
This behavior should be be achievable using the appropriate WooCommerce filter hook which checks for the “Visible on the product page” flag.
One easy idea would be to disable a specific attribute globally using something like the following code:
// Globally disable attribute visibility for MY TAXONOMY
add_filter('woocommerce_get_product_attributes', function($attributes) {
foreach ($attributes as $key => $attribute) {
if ($attribute['is_taxonomy'] && $attribute['name'] == 'MY_TAXONOMY') {
$attributes[$key]['is_visible'] = false;
}
}
return $attributes;
}, 10, 1);
Note that the above code is untested.
Otherwise the following filter should get you on track if you are looking for a term specific behavior: woocommerce_get_product_terms
.
However, I do not see this as adequate plugin extension, since displaying term titles in the “Additional information” tab and displaying new tabs with extension information about that term are two separate things, than can co-exist without causing any redundant information. Furthermore, it is possible to control this behavior by setting the “Visible on the product page” option on the product level (which is of course cumbersome if you have a lot of products).
Kind regards,
Mike