Hide Empty Categories
-
When all products from a specific category have as parameter “visibility = 0”, their product page still exist but those products are hidden from their category. So basically, the woocommerce product category should be hidden from the list of categories, right ? At least I was expecting this as a native behavior from woocommerce.
However, woocommerce does not seem to act like this and the category is still visible, even if it is empty. Some people tried to found a way here in the git (thx to
DarkAllMan) = https://gist.github.com/DarkAllMan/cffb114eb97c6f26882e54793e023587
But the fact is this does not work anymore… (throwing fatal error as explained in comment).
His there anybody here that is able to suggest a fix for this very usefull function ?Edit : I’ve also tried this function = https://chrisk.io/woocommerce-hide-categories-with-no-visible-products-in-the-product-category-widget/
this is working from the main shop page view but not when we are in a product category page view and single product page view… any ideas ?
- The topic ‘Hide Empty Categories’ is closed to new replies.