dynambee Posted May 15, 2017 Share Posted May 15, 2017 Is there any way to automatically hide categories (front office) that don't have any products assigned to them? Basically if there are products in the category I want customers to see the category. If there aren't products in the category then I'd prefer if the category doesn't appear in the front office. Link to comment Share on other sites More sharing options...
moy2010 Posted May 15, 2017 Share Posted May 15, 2017 Afaik, only with paid modules Link to comment Share on other sites More sharing options...
yaniv14 Posted May 15, 2017 Share Posted May 15, 2017 There are many ways to achieve this. I would probably override getSubCategories() function or assignSubcategories() from the controller. This will only deal with category page. You will also need to override blockcategories module getTree() function if you want to hide it from the module as well. If you need to hide it from the top menu than its a bit more complicated. of course you can also do it inside the template, but I don't recommend it. Link to comment Share on other sites More sharing options...
dynambee Posted May 16, 2017 Author Share Posted May 16, 2017 Thanks everyone. It seems like something that would make an ideal standard back office option for 30bz, but I'm sure there are other higher priority things to implement. For now I will manage this through the API by setting the "displayed" option as needed depending on if there are any available items in a given category. Link to comment Share on other sites More sharing options...
dosbiner Posted May 16, 2017 Share Posted May 16, 2017 @dynambee +1 that would be great feature, plus auto disable products that has empty stock (I still use mysql trigger to do this) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now