• Resolved Ordog

    (@ordog)


    Hello,

    First of all, this is a great plugin and thank you very much for building this.

    We’ve modified our store to show empty categories by using the below function:

    add_filter( 'woocommerce_product_subcategories_hide_empty', '__return_false' );

    This now works on category pages but it doesn’t show empty categories in the search results. Other categories show just fine, it’s just empty ones that do not.

    Is there a function that I can add to change this in your plugin please?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hello,

    Yes, it is possible. Please use following code

    add_filter( 'aws_terms_search_query', 'my_aws_terms_search_query' );
    function my_aws_terms_search_query( $sql ) {
        $sql = str_replace( 'AND count > 0', '', $sql );
        return $sql;
    }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Also after adding this code you will need to go to the plugin settings page and click the ‘Clear cache’ button.

    Regards

    Thread Starter Ordog

    (@ordog)

    That’s spot on and works a treat – thank you very much!

    I’ve just realised that I haven’t reviewed your plugin so I’ll do that now which is the least I can do to show my gratitude.

    Plugin Author ILLID

    (@mihail-barinov)

    Glad to help. And thanks for your review.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing empty categories’ is closed to new replies.