The tutorial shows how to fix “An error occurred while updating an object. product ()” error in PrestaShop.
You can get this error in the process of adding or editing the product in PrestaShop when PrestaShop 220.127.116.11 template is installed into PrestaShop 18.104.22.168 version.
The issue is usually caused by the lack of columns in the products database.
You can check what exactly causes the issue by turning on the debug mode in config/defines.ini.php file on FTP.
Just replace define(‘_PS_MODE_DEV_’, false); with define(‘_PS_MODE_DEV_’, true); in order to switch on the errors on the frontend.
In order to fix the error, please follow the steps below:
Log into your Hosting Cpanel with your Hosting Cpanel login credentials – the username and password.
Navigate to PhpmyAdmin tool and open the database used for this installation.
Click the ‘SQL’ tab.
Copy – paste the following piece of code into the SQL tab in the database:
ALTER TABLE `ps_product` ADD `pack_stock_type` int(11) UNSIGNED DEFAULT '3'; ALTER TABLE `ps_product_shop` ADD `pack_stock_type` int(11) UNSIGNED DEFAULT '3'; ALTER TABLE `ps_pack` ADD `id_product_attribute_item` int(10) UNSIGNED NOT NULL AFTER `id_product_item`; ALTER TABLE `ps_pack` DROP PRIMARY KEY;
Feel free to check the detailed video tutorial below: