tsyirvo Posted November 9, 2015 Share Posted November 9, 2015 (edited) 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, Edited November 19, 2015 by tsyirvo (see edit history) Link to comment Share on other sites More sharing options...
tsyirvo Posted November 11, 2015 Author Share Posted November 11, 2015 Anyone has an idea on how to fix this ? I still can't figure out what's wrong :/ Link to comment Share on other sites More sharing options...
tsyirvo Posted November 19, 2015 Author Share Posted November 19, 2015 I finally understood where this was coming from! The column "id_stock_available" wasn't set on "AUTO_INCREMENT"… I don't know why this was not the case but after updating the table, everything started working fine again! 1 Link to comment Share on other sites More sharing options...
Varadi Posted March 13, 2019 Share Posted March 13, 2019 Than you tsyirvo, very few information about stock issue on this "amazing" presatshop 1.7.. on the web yet, for me still doesn't fix the problem because mine is set for auto_increment but at least we are closer Link to comment Share on other sites More sharing options...
seohost.pl Posted February 27, 2020 Share Posted February 27, 2020 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 Link to comment Share on other sites More sharing options...
DanieleZanutti Posted April 25, 2020 Share Posted April 25, 2020 Perfetto, stesso problema e uguale soluzione. Adesso lavora bene. Grazie. Perfect, same problem and same solution. Now it works well. Thanks. 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