Support » Plugin: WooCommerce » Hide / Unhide Empty Categories

  • Resolved bruno05

    (@bruno05)


    I would like to show the empty categories on the shop page. I have set the display to only show categories on the shop page. However only the categories that have products are showing. Cannot figure out where is the setting to show categories, including empty ones.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi

    Code for WooCommerce 3.x+
    Place the following in your functions.php file of your theme:

    
    add_filter( 'woocommerce_product_subcategories_hide_empty', 'hide_empty_categories', 10, 1 );
    function hide_empty_categories ( $hide_empty ) {
        $hide_empty  =  FALSE;
        // You can add other logic here too
        return $hide_empty;
    }

    Thanks
    Ahir

    That fixed it. So to confirm version 3.5.1 version hides empty categories by default? And to show all categories The above code snippet has to be used? If so, here is my request for s future enhancement. Please make this as a display option in the customizer.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide / Unhide Empty Categories’ is closed to new replies.