Support

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. - https://php.spinxweb.net/redbarn/product-category/dog-treats/chews/

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 - https://php.spinxweb.net/redbarn/product-category/dog-treats/dental/

Hello

Paste your license key here - https://c2n.me/42HBIt7.png

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: https://www.screencast.com/t/BlEErQraBx

It's Dental category and it's not showing. https://www.screencast.com/t/SlVKkabOw

Hello

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:

Dental: https://www.screencast.com/t/SlVKkabOw

Here it's showing: https://www.screencast.com/t/BlEErQraBx

We need to display parent category dropdown like (Chew) - https://www.screencast.com/t/BlEErQraBx 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.

Thanks.

 

 

Hello

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 - https://c2n.me/42Owp9m.png

In this case, you need to assign the parent term as the current one - https://c2n.me/42Oxynh.png

We have created three-level hierarchy category (http://prntscr.com/olzxlz) and Dental  is a second level category, Dog treat is dental parent category see - https://nimb.ws/Mi0v3u

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.

Thanks

 

 

Hello

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.