Jump to content

[Solved] Can't Update Stock Quantity In Bo


tsyirvo

Recommended Posts

Hi,

 

My shop is having issues with setting the quantity available for new products.

Since I moved my site hosting, when I create a new product, I can't set a quantity value. Each time I put a number and save, the input goes back to 0...

This happen for all the new products I add whether it is a simple product or one with combinations. On existing product there is no problem. I am using the default stock management system.

 

While searching for where this could come from, I noticed that on the db table ps_stock_available, new rows are not properly created for newly added products.

Each time a new product is added,  a row is created with the correct product id and quantity set to 0 (which is normal at this point) but the column id_stock_available is set to 0… In the BO, when changing the quantity of this product, nothing is saved in the db and the input goes back to 0. If I decide to create another new product, the row of this product is created with the new product id and id_stock_available still set to 0 but the row of the previously created product disappears. I think it is deleted because it has the same id 0  for id_stock_available than the product created after.

You can see this on the screenshot below.

 

I have been searching for how to fix this but nothing works :/

 

Does anyone had a similar problem or knows how to fix this one ?

Thanks for the help!

 

Cheers,

post-843409-0-39865700-1447093457_thumb.png

Edited by tsyirvo (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 years later...
  • 11 months later...

I had similiar isssue:

[PrestaShopDatabaseException]

Lock wait timeout exceeded; try restarting transaction
 

UPDATE `ps_stock_available` SET `id_stock_available` = '316',`id_product` = '16288',`id_product_attribute` = '0',`id_shop` = '1',`id_shop_group` = '0',`quantity` = '0',`depends_on_stock` = '0',`out_of_stock` = '0',`location` = '' WHERE `id_stock_available` = 316


at line 769 in file classes/db/Db.php

764. if ($webservice_call && $errno) { 765. $dbg = debug_backtrace(); 766. WebserviceRequest::getInstance()->setError(500, '

 ' . $this->getMsgError() . '. From ' . (isset($dbg[3]['class']) ? $dbg[3]['class'] : '') . '->' . $dbg[3]['function'] . '() Query was : ' . $sql, 97); 767. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) { 768. if ($sql) { 769. throw new PrestaShopDatabaseException($this->getMsgError() . '<br /><br /><pre>' . $sql . '</pre>'); 770. } 771. 772. throw new PrestaShopDatabaseException($this->getMsgError()); 773. } 774. }


 

And also auto increment on that field 

screenshot-opony-tanio.net-2020.02 (1).png

Link to comment
Share on other sites

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...