Content of the article

You need to log-in to create request (topic) to the support

Hierarchy category is not display if no sub category

(new from 01-07-2019)

In this page, both dropdowns are displayed. -

We need to display category dropdown like the above URL if subcategory is not available. In this url dropdown is not display can you help us to resolve -


Paste your license key here -

if the current category has no children, the filter will not show anything.

Actually Category has some value but child category does not have value.
If child category don't show that should be fine but here in our case even main category getting hide some how when page load. Main category are not showing.

Here it's showing:

It's Dental category and it's not showing.


Yes! On the category(taxonomy) page, the filter shows only child categories(taxonomies)

 This is a very logical behavior. On the category page, you can show ONLY products that belong to the category OR child category. It makes sense to show only child categories( of the current category ), because clicking on any other category will always give zero products   )  For this reason, the filter hides the main category.

But very similar level other category it's showing category dropdown only for "dental" it's not showing:


Here it's showing:

We need to display parent category dropdown like (Chew) - If no child category that makes sense.

Can you please guide us on how we can extend this functionality with a hook or which plugin file code we need to update or any other way.

Let us know if you want any other detail.





Unfortunately we do not have a ready solution.

the  code in file - plugins\woocommerce-products-filter\ext\select_hierarchy\views\woof.php  - current category is defined here -

In this case, you need to assign the parent term as the current one -

We have created three-level hierarchy category ( and Dental  is a second level category, Dog treat is dental parent category see -

We have to do code as you provided path file  plugins\woocommerce-products-filter\ext\select_hierarchy\views\woof.php but this file has not executed the code on a dental page.

Can you please provide a step to add into the plugin code.





but this file has not executed the code on a dental page. - This file works on all pages where there is a filter.

Unfortunately, we do not have a ready solution (I wrote this before). And customization of the code is not included in the support. In this case, you should hire a developer.