electrical-store Posted April 23, 2013 Share Posted April 23, 2013 Hi I am trying to update the stock on my website with SQL query but it is not working. This is what I have: UPDATE ps_product SET quantity = [{NewQuantity}], date_upd = '[{dProcessedOn}]' WHERE reference = '[{ChannelSKU}]'; --GO;-- UPDATE ps_product_attribute SET quantity = '[{NewQuantity}]' WHERE reference = '[{ChannelSKU}]'; Can someone tell me what I am doing wrong. Thanks in advance. Link to comment Share on other sites More sharing options...
vekia Posted April 23, 2013 Share Posted April 23, 2013 what prestashop version you use? Link to comment Share on other sites More sharing options...
electrical-store Posted April 24, 2013 Author Share Posted April 24, 2013 Hi I am using the newest version and have solved the issue. UPDATE `ps_stock_available` AS sa INNER JOIN `ps_product` AS p on p.id_product = sa.id_product SET sa.quantity = CONVERT('[{NewQuantity}]', signed integer), p.quantity = CONVERT('[{NewQuantity}]', signed integer) WHERE p.reference = '[{ChannelSKU}]' --GO;-- UPDATE ps_product_attribute SET quantity = CONVERT('[{NewQuantity}]', signed integer) WHERE reference = '[{ChannelSKU}]'; This seems to be working thanks. Link to comment Share on other sites More sharing options...
vekia Posted April 24, 2013 Share Posted April 24, 2013 hello thanks for sharing the solution, i can go ahead and mark this thread as solved regards Link to comment Share on other sites More sharing options...
Recommended Posts