Reply 188122 to: Subcategories displaying filters

Avatar: denvysb
denvysb
Participant
March 13, 2018 at 20:55

Hi your code did not work. I don’t think the code “woocommerce_category_archive_display” exists anywhere on your theme and therefore was always returning the result string(“”).

Spent a lot of time searching up and down on woocommerce to find out which function returns whether a page displays only products/ only subcategories/ both.

Found the following code woocommerce_products_will_display() that returns whether a page shows products or not.

I wrapped the following code around the filter and now it is working as intended with woocommerce settings. If it is set to display no products and only subcategories then the filter will be removed

<?php if ( woocommerce_products_will_display()) : ?>
<?php endif; ?>

I have made this change on the core file, so next update will remove this code if not fixed in core. Can you please ensure on your next update this bug is fixed and updated with the above code.

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.