How to check if the product is in a certain category on a single-product.php in Woocommerce?
I don’t think get_categories() is the best option for you in this case because it returns a string with all the categories listed as anchor tags, fine for displaying, but not great for figuring out in code what the categories are. Ok, so the first thing you need to do is grab the product/post object … Read more