webbusiness23 Posted May 18, 2014 Share Posted May 18, 2014 (edited) Hello, How can i update the quantity for a list of products? I've selected the IDs that i'm interested in modifying their quantity and i have come up with this SQL query which i've run inside the ps_product table: UPDATE `ps_product` SET `quantity` =0 WHERE `id_product` IN ( 316, 317, 318 ) The IDs 316,317,318 are the ids that i need to modify the quantity from its current value to zero. The result is: 3 rows modified, but the actual quantity in BO is the same, it's not zero, as i thought it would be. How can i achieve my goal? Please see attached picture to see the place i need zero quantity. Edited May 19, 2014 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 18, 2014 Share Posted May 18, 2014 you have to modify ps_stock_available table 2 Link to comment Share on other sites More sharing options...
webbusiness23 Posted May 19, 2014 Author Share Posted May 19, 2014 You are right. That was the place. Thank you very much! Solved! Link to comment Share on other sites More sharing options...
vekia Posted May 19, 2014 Share Posted May 19, 2014 you're welcome :-) glad ot hear that i could help a little i marked topic title as solved. with regards, Milos Link to comment Share on other sites More sharing options...
wmh90 Posted July 16, 2014 Share Posted July 16, 2014 Awesome, thanks! Link to comment Share on other sites More sharing options...
jonyellery Posted November 20, 2015 Share Posted November 20, 2015 good answer! Link to comment Share on other sites More sharing options...
estevecv Posted July 3, 2018 Share Posted July 3, 2018 Hello, How can I update all the products quant. =1 to 0? I have a dropshipping business and I want to reduce stock issues with providers... I have prestashop 1.7.2 Thks! Link to comment Share on other sites More sharing options...
Sasha Chirico Posted December 21, 2018 Share Posted December 21, 2018 (edited) On 5/19/2014 at 9:12 PM, vekia said: you're welcome 🙂 glad ot hear that i could help a little i marked topic title as solved. with regards, Milos How can I do the same, but for all the products? I want 1 as quantity for all the products. The query is:? UPDATE `ps_stock_available` SET `quantity` =1 Edited December 21, 2018 by Sasha Chirico SQL Code (see edit history) Link to comment Share on other sites More sharing options...
Ignacioa Posted August 24, 2023 Share Posted August 24, 2023 I got a table (lanix) with: quantity , price, reference, id_product (null if if it's not in my erp) So this do quantity and price update: UPDATE psso_product INNER JOIN psso_lanix ON psso_product.id_product = psso_lanix.id_product SET psso_product.price = psso_lanix.price, psso_product.quantity = psso_lanix.quantity; UPDATE psso_product INNER JOIN psso_product_shop ON psso_product.id_product = psso_product_shop.id_product SET psso_product_shop.price = psso_product.price; UPDATE psso_stock_available INNER JOIN psso_product ON psso_stock_available.id_product = psso_product.id_product SET psso_stock_available.quantity = psso_product.quantity; Can be more efficient but, i need to know which products in my ERP are not sync so in lanix.id_product null means product not in prestashop. 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