brainstormtrooper Posted July 11, 2014 Share Posted July 11, 2014 Hi, I'm trying to get the Category class to return only products with a quantity greater than 0 in PS 1.6 I tried http://www.prestashop.com/forums/topic/256812-modify-getproducts/?hl=select+product+with+quantity but it didn't seem to change anything. I don't want them disabled, just not presented... I have them hidden in the template, but then pagination is messed up. Thanks in advance for any help or advice, Link to comment Share on other sites More sharing options...
nicej3 Posted March 18, 2015 Share Posted March 18, 2015 Hi Have you solved the problem? I have same situation here and I need a solution! Tks! Link to comment Share on other sites More sharing options...
rocky Posted March 19, 2015 Share Posted March 19, 2015 I suggest overriding the Category::getProducts() function. Copy the entire function into the override and then change both WHERE to: WHERE p.`quantity` > 0 AND I haven't tested this, but it should make all products without stock invisible. It might make them invisible in the Back Office too though. If that happens, you'll have to use more complicated code like: WHERE '.(substr(Tools::getValue('controller'), 0, 5) != 'Admin' ? 'p.`quantity` > 0 AND ' : '').' Good luck 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