vishalsingh119 Posted July 8, 2016 Share Posted July 8, 2016 Hi guys, i am facing an issue ,i have one category that have two disable or out of stock product.so i want to hide category automatically not by admin pannel.How to disable the category if all product in category disable.if any product have stock then category visible. so tell me some msqul query or php script Link to comment Share on other sites More sharing options...
musicmaster Posted July 8, 2016 Share Posted July 8, 2016 You could use a mysql trigger that with each product deletion/disabling/out-of-stock checks whether the categories involved now have zero products and then switches it off. You would need a second trigger that in order to switch it on again when products become available. Link to comment Share on other sites More sharing options...
vishalsingh119 Posted July 11, 2016 Author Share Posted July 11, 2016 Hi, i tried your post name- Prestools Suite: Mass Edit, Order Edit And Much More but sorry its not working,kindly send me the mysql trigger code or php code so that i directly apply on it. thanks in advanced Link to comment Share on other sites More sharing options...
vishalsingh119 Posted July 12, 2016 Author Share Posted July 12, 2016 You could use a mysql trigger that with each product deletion/disabling/out-of-stock checks whether the categories involved now have zero products and then switches it off. You would need a second trigger that in order to switch it on again when products become available. I tried the mysql trigger but they are not working,better if you have some php customization code.so guide me for that,so i change in php file 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