I'm trying to hide the related products on single product pages in a category (using Woocommerce). This is what I have so far, and it hides related products on ALL categories:
function wc_remove_related_products( $args )
{
if (is_product() && has_term( 'Donations', 'product_cat'))
{
return array();
}
}
add_filter('woocommerce_related_products_args','wc_remove_related_products', 10);