Prestashop: Product changes of quantity are not being saved - prestashop 1.7.5.

Created on 8 Jan 2019  路  14Comments  路  Source: PrestaShop/PrestaShop

Describe the bug
When I try to modify the stocks of product, I get a "Changes saved" message, but the quantity is not changed. I tried to modify the quantity form "Stocks" and also from Products, but does not work.
Any other change to the product saves just fine.
I've just made an upgrade from 1.7.4.3 to 1.7.5.0.
I've emptied the cache, disabled cache, checked permissions....nothing worked.

To Reproduce
Steps to reproduce the behavior:

  1. Go to "Products Catalogue - Stocks " or "Products Catalouge - Products - Quantity"
  2. Change product quantity and save

Additionnal information
PrestaShop version: 1.7.5.0
PHP version: 7.2.7

Thank you!

1.7.5.0 BO Bug No change required Products Stocks

Most helpful comment

Hi,
Thank you for your replies!
I've cleared manually the cache folder and still does not work.
In the override folder i did not found any overrides for stocks.

@PrestaShark PrestaShark,
I have another site with prestashop 1.7.1.0 and the column "location" does not exist there, and there is no problem with the products.
I'll try your solution and come back with an answer.
Thank you!

All 14 comments

Hi @Madalina-nadari,

Could you please provide us with more info? We need more details to understand how we can reproduce your issue:

  • host
  • server setup and configuration
  • PrestaShop version (source)
  • debug mode report
  • PHP error logs
  • apache error log
  • javascript console log
  • screenshots

Don't you know how to get this information? Please read the following article:
http://build.prestashop.com/howtos/misc/how-to-create-bug-report/

Thanks!

Hi, I'll try to give as much information I can.
Host - Hostx
Server setup: Operating system - Linux
Type and version of webserver - Apache
Version of PHP 5.6.39
Version of MySQL 5.6.42-cll-lve
Prestashop version 1.7.5.0
Browser: Chrome, Edge

ERROR LOG:
[08-Jan-2019 18:29:03 Europe/Bucharest] PHP Notice: Undefined index: content_global in /home/nadariro/public_html/nadari-toys.ro/var/cache/prod/smarty/compile/9f/cd/16/9fcd16c541d6942c224541081ea4ca047074cbb8_2.file.nrtcustomtab.tpl.php on line 44
[08-Jan-2019 18:29:03 Europe/Bucharest] PHP Notice: Trying to get property of non-object in /home/nadariro/public_html/nadari-toys.ro/var/cache/prod/smarty/compile/9f/cd/16/9fcd16c541d6942c224541081ea4ca047074cbb8_2.file.nrtcustomtab.tpl.php on line 44

In files you can see pictures from the debug mode. I have no errors there, just warnings and deprecations.
debug deprecations
debug info

Hope that helps.
I've also seen that in Products -stocks - Movements - the modifications are registered, but the final result is not changed, as you can see in the pictures.
Initial stock of the product was 5 and the movements were: -2, -2, -5, -5 and the product still shows the final stock of 5.
stock movements
stock unmodified

Thank you!

Hi @Madalina-nadari,

Could you please try to clear cache manually by deleting all the folder into var/cache (prod & dev).
Thanks to check if you have any overrides added by a custom module, it could be a problem.
Thanks!

Same here!

[PrestaShopDatabaseException]

When debug is on

Unknown column 'location' w field list

SELECT location
FROM ps_stock_available
WHERE (id_product = 739) AND (id_product_attribute = 0) AND (id_shop = 1) AND (id_shop_group = 0) LIMIT 1

Just add column location in ps_stock_available table and stocks will be updated. Tested. **Template:** location` varchar(255) NOT NULL DEFAULT '',

Hi,
Thank you for your replies!
I've cleared manually the cache folder and still does not work.
In the override folder i did not found any overrides for stocks.

@PrestaShark PrestaShark,
I have another site with prestashop 1.7.1.0 and the column "location" does not exist there, and there is no problem with the products.
I'll try your solution and come back with an answer.
Thank you!

location column is new in 1.7.5 (new feature) and upgrade process from 1.7.4.3 missed to add this...

location column is new in 1.7.5 (new feature) and upgrade process from 1.7.4.3 missed to add this...

Hi!
@PrestaShark I've managed to create the column location but it looks like this:
ALTER TABLE pstoysstock_available ADD location VARCHAR(255) NOT NULL AFTER out_of_stock;
If I put Not Null Default After out_of_stock; I get an error.
The stocks work now, without "Default" in the syntax. Is that ok? Or I should try to put the "Default" in there?

Thank you!

Hi all,

During the upgrade, the location is added to the PREFIX_stock_available table.
You can view this link
In my case, I did not manage to reproduce the issue after the upgrade from PS1.7.4.4 to PS1.7.5.0.
image
Thanks!

Hi!
I've checked the stock_available table and, indeed, the location table is in there, but after I made the modification that @PrestaShark suggested, my stocks are working again.... I don't know why and I still have to check some modules from the theme, because It seems I have other errors in debug mode.
So, thank you all for helping me!

Hi @Madalina-nadari,

I'm glad to see it worked.
I close the issue, feel free to open a new one when needed.
Thanks!

Hey ! I've got the same problem...

I've upgraded from 1.7.4.x to 1.7.5 with 1Click Upgrade.

The column was on DEV database version but when I deploy with GIT to Prod nothing happen even if I've executed on prod the doctrine:schema:update.

location column was not there before I added it manually...

But that SQL was ok :

ALTER TABLE PREFIX_stock_available
ADD location VARCHAR(255) NOT NULL DEFAULT '' AFTER out_of_stock;

I have the same problem, attached error screen.
My template does not support the update to 1.7.5.2. I currently have version 1.7.2.4.
I need help, nobody will know what the problem is.
Thanks a lot!
Stock

Hi @sebaborda04,

This issue is currently closed, can you open a new one with more information about your configuration in English
Thanks!

Was this page helpful?
0 / 5 - 0 ratings