Answer the question
In order to leave comments, you need to log in
How to display a block in a product from a specific category?
Good afternoon, forum users.
There is a block on the product page that should be in the ID=20 category, but not in the ID=28 category.
Please tell me how to implement it. I searched the entire Internet, and the forum, did not find anything like it, maybe of course I looked inattentively. In general, did no one come across such a thing, I do not believe it.
Tried through:
<?php
if (! is_product_category( array ( '28' ) )) {
echo '<p>Кол-во упаковок:</p>';
}
?>
Answer the question
In order to leave comments, you need to log in
Here is the link to the article - https://rudrastyh.com/woocommerce/if-product-in-ca...
You need to check if this product belongs to category X
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question