brownd92 Posted October 23, 2013 Share Posted October 23, 2013 Hi there, Can someone help me with a SQL statement so I can disable all products which are out of stock in the warehouse. There is only one warehouse and all shops (multistore) are configured to use the sock from this warehouse. I need something like: Set all products enabled = 0 where stock in warehouse <=1 Thanks in advance. I know SQL ok, but Im quite new to prestashop and I am not too sure of the schema.... Link to comment Share on other sites More sharing options...
parsifal Posted October 23, 2013 Share Posted October 23, 2013 (edited) You only want to run this once? If not, wouldn't it be better if you setup a MySQL trigger to take care of it automatically? http://mypresta.eu/en/art/tips-and-tricks/how-to-disable-out-of-stock-product.html Check this related topic: http://www.prestashop.com/forums/topic/258359-how-to-hide-out-of-stock-products-in-prestashop-1541 Edited October 23, 2013 by parsifal (see edit history) Link to comment Share on other sites More sharing options...
brownd92 Posted October 23, 2013 Author Share Posted October 23, 2013 Thanks for the info. Will this work for multistore? Where advanced stock management and products are all stored in one warehouse? Thanks Link to comment Share on other sites More sharing options...
parsifal Posted October 23, 2013 Share Posted October 23, 2013 I think I read a post somewhere in the forum where it was stated that the quantities stored in the "ps_stock_available" table are the sum of the quantities in all warehouses. Since you only have one warehouse, this number should always coincide. 1 Link to comment Share on other sites More sharing options...
brownd92 Posted October 23, 2013 Author Share Posted October 23, 2013 Thanks Link to comment Share on other sites More sharing options...
vekia Posted October 23, 2013 Share Posted October 23, 2013 brownd92 have you checked it? does it work as you expected? Link to comment Share on other sites More sharing options...
brownd92 Posted October 23, 2013 Author Share Posted October 23, 2013 Yes I have tried it and it dosent work! I can still see the products in the front office... In the back office it looks as if they have been disabled but not on the front end. Link to comment Share on other sites More sharing options...
vekia Posted October 23, 2013 Share Posted October 23, 2013 you use advanced stock managment? Link to comment Share on other sites More sharing options...
brownd92 Posted October 23, 2013 Author Share Posted October 23, 2013 Yes Link to comment Share on other sites More sharing options...
brownd92 Posted October 24, 2013 Author Share Posted October 24, 2013 Anyone any ideas please? Link to comment Share on other sites More sharing options...
vekia Posted October 24, 2013 Share Posted October 24, 2013 it's because solutions above doesn't support advanced stock manager. Im going to check it with advanced stock manager and i will let you know Link to comment Share on other sites More sharing options...
brownd92 Posted October 24, 2013 Author Share Posted October 24, 2013 (edited) Thank you so much :-) Edited October 24, 2013 by brownd92 (see edit history) Link to comment Share on other sites More sharing options...
brownd92 Posted October 28, 2013 Author Share Posted October 28, 2013 Hi there, Any luck with this? Thanks Link to comment Share on other sites More sharing options...
brownd92 Posted October 29, 2013 Author Share Posted October 29, 2013 Sorry to bring this up again. But has anyone any idea how to disable products which are not in stock for advanced stock management. Link to comment Share on other sites More sharing options...
vekia Posted October 29, 2013 Share Posted October 29, 2013 take a look here: http://www.prestashop.com/forums/topic/278029-free-module-hide-disable-products-when-they-are-out-of-stock/ i know that this is module, but it works so maybe you can check module code for sql query 1 Link to comment Share on other sites More sharing options...
brownd92 Posted October 29, 2013 Author Share Posted October 29, 2013 Thanks for the response. Ive had a look at it and I dont see any difference than what the sql statement was doing above? Maybe Im missing something? Link to comment Share on other sites More sharing options...
Diego Galma Posted September 10, 2014 Share Posted September 10, 2014 Here its the best module to do this http://www.prestashop.com/forums/topic/344050-free-update-elements-display-only-active-products-categories/ 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