Restricted category in Woocommerce [closed]

The function that solves it should do the following : Loops through each product in the category For each item, retrieve the list of categories the product is in. If there is only one category and it’s the ‘restricted’ category, then the product is excluded from the query. Here’s an example : function exclude_category_archive_products( $q …

Read more

Add text below WooCommerce short description if metabox value is true

Following the suggestion by @1inmillion, I put the second filter inside the first IF statement, which works nicely. This is the combined code: // 1. Add text below short description function bja_product_unavailable_text( $content ) { $content .= ‘<div class=”bja_product_unavailable”>This product is unavailable</div>’; return $content; } // 2. Remove add to cart button if product is …

Read more