0

I'm trying to hide empty categories based on an attribute selected previously.

Basically I have a vehicle parts website and a customer can choose a vehicle model and I've changed the products collection to only show products that are compatible with this vehicle but we have some categories that will have no products in them now and I want to hide these on the fly as a customer can change the selected vehicle at will.

These categories need to be hidden from view in all menus, sidebars etc.

I used a plugin for the products and presume I'd be able to use the same for this but I don't know which class/function to plugin around to inject code for this to work.

Any help would be really appreciated.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.