How to apply CSS for products with hidden catalog visibility?
-
For some products, I use a function to change the catalog visibility to hidden.
Example: $ product-> set_catalog_visibility (‘hidden’);
Now, for all such products, I need to display specific text in the main product description.
But I cannot find the difference in these products as no extra class is added for hidden products.How can I write a function that will be marked to apply the function only when the product visibility is “Hidden”?
Example:
function woocommerce_hidden () { echo '<div class = "woocommerce_hidden"> text </div>'; } add_action ('woocommerce_before_add_to_cart_form', 'woocommerce_hidden', 5);
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to apply CSS for products with hidden catalog visibility?’ is closed to new replies.