
websmileziko(@websmileziko)
4 Posts
Customers
Quote from websmileziko on June 17, 2021, 10:42
Hello, I have an interesting problem. I set the option "hide empty terms" in my filters. It hides filters that have terms in them. For example in this category: https://sportconcept.bg/%D0%BC%D1%8A%D0%B6%D0%B5/%D0%BC%D0%B0%D1%80%D0%B0%D1%82%D0%BE%D0%BD%D0%BA%D0%B8-%D0%BA%D0%B5%D1%86%D0%BE%D0%B2%D0%B5/
If you scroll, you can see that the 3rd filter (with sizes) has terms for "40 (190)". If I start the "hide empty terms" option - 40 disappears as a filter.
Hello, I have an interesting problem. I set the option"hide empty terms" in my filters. It hides filters that have terms in them. For example in this category: https://sportconcept.bg/%D0%BC%D1%8A%D0%B6%D0%B5/%D0%BC%D0%B0%D1%80%D0%B0%D1%82%D0%BE%D0%BD%D0%BA%D0%B8-%D0%BA%D0%B5%D1%86%D0%BE%D0%B2%D0%B5/
If you scroll, you can see that the 3rd filter (with sizes) has terms for"40 (190)". If I start the"hide empty terms" option - 40 disappears as a filter.

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on June 17, 2021, 17:53
Hello
Looks like you are using custom code to get terms.
In fact, you don't have any product with a size 40 - https://share.pluginus.net/image/i20210617184703.png
And when the option is set (hide empty terms) my plugin excludes them from the request - https://share.pluginus.net/image/i20210617184912.png
So in file - \public_html\wp-content\plugins\woocommerce-products-filter\classes\helper.php - I added this code - https://share.pluginus.net/image/i20210617185034.png - Result - https://share.pluginus.net/image/i20210617185109.png
Hello
Looks like you are using custom code to get terms.
In fact, you don't have any product with a size 40 - https://share.pluginus.net/image/i20210617184703.png
And when the option is set (hide empty terms) my plugin excludes them from the request - https://share.pluginus.net/image/i20210617184912.png
So in file - \public_html\wp-content\plugins\woocommerce-products-filter\classes\helper.php - I added this code - https://share.pluginus.net/image/i20210617185034.png - Result - https://share.pluginus.net/image/i20210617185109.png

websmileziko(@websmileziko)
4 PostsTopic Author
Customers
Quote from websmileziko on June 19, 2021, 12:36
Hey,
thank you :) Interesting that the woocommerce admin shows 0 terms, but if you click in the zero it shows the products with "40". I clean every cache and cleck on recount woocommerce terms but no luck. After your changes, it works fine. One last question. I shouldn't update the plugin now - right?
Hey,
thank you :) Interesting that the woocommerce admin shows 0 terms, but if you click in the zero it shows the products with"40". I clean every cache and cleck on recount woocommerce terms but no luck. After your changes, it works fine. One last question. I shouldn't update the plugin now - right?

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on June 21, 2021, 11:25
Hello
I shouldn't update the plugin now - right? - Unfortunately yes. We cannot add this customization to the new version.
Hello
I shouldn't update the plugin now - right? - Unfortunately yes. We cannot add this customization to the new version.