Pepozzo Posted February 6, 2013 Share Posted February 6, 2013 Hello! I'm using a PHP script to update product quantities in my store. This script uses this SQL query: $query_upd = "UPDATE ps_product SET quantity='5' WHERE id_product='$id_prod'"; $result_upd = mysql_query($query_upd)or die(mysql_error()); Query works well and i have no error. Checking the mysql field on my database is correctly set to "5" or "0" (in case of 0 quantity), but when i check the item on my back-end, the quantity is not changed. For example if i set quantity as 0, in my back-end the item remains with quantity = 5. How can i solve this problem? Thanks in advance Link to comment Share on other sites More sharing options...
apomed Posted February 6, 2013 Share Posted February 6, 2013 For my understanding your problem is not this query but the query which returns the value to show it in your Backend Link to comment Share on other sites More sharing options...
m.andrzejak Posted February 6, 2013 Share Posted February 6, 2013 Try or check second table where PS store quantity of product: $query_upd_2 = "UPDATE ps_stock_available SET quantity='5' WHERE id_product='$id_prod'"; Take big notice to id_shop, if you aren't using multishop forgot it. Link to comment Share on other sites More sharing options...
BillyHardcore Posted February 7, 2013 Share Posted February 7, 2013 Yeah, stock is stored more than one place in this version. I think there is even some rudimentary rows from previous versions. Link to comment Share on other sites More sharing options...
c.tranquilli Posted April 9, 2013 Share Posted April 9, 2013 Hi, I have update the 2 table, product and stock_available but on the backoffice i continue ti view the old quantoty value, there is other table to update? Thanks Link to comment Share on other sites More sharing options...
cyjambo Posted April 22, 2013 Share Posted April 22, 2013 Hi, I just had the same issue, glad I found this thread. I had to look in ps_stock_available table instead of ps_product table. Now everything is working as it should. Thanks! 1 Link to comment Share on other sites More sharing options...
Recommended Posts