maxetere Posted July 25, 2018 Share Posted July 25, 2018 Hi guys, on version 1.6.1.19 and 1.6.1.20 if you add/modify a product Prestastop change "date_upd" on table "ps_product" to ALL product of same category. Link to comment Share on other sites More sharing options...
Bulldesign Posted November 6, 2021 Share Posted November 6, 2021 It's an old thread, but if anyone is interested in fixing this behaviour, then it happens because of this inside Classes/Product.php. // mark all products whose position within category (might) have changed as modified $return &= Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'product` p'.Shop::addSqlAssociation('product', 'p').' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = '.$idCategory.' AND cp.`id_product` = p.`id_product` AND cp.`position` >= '.$position.') SET p.`date_upd` = "'.$now.'", product_shop.`date_upd` = "'.$now.'" '); If you are on PS 1.6, you can fix it by commenting out the last SET line $return &= Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'product` p'.Shop::addSqlAssociation('product', 'p').' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_category` = '.$idCategory.' AND cp.`id_product` = p.`id_product` AND cp.`position` >= '.$position.')'); /* SET p.`date_upd` = "'.$now.'", product_shop.`date_upd` = "'.$now.'" */ The behaviour happens for all versions of PrestaShop, not just 1.6. It's because the category position ID's of all the products in the same category as the product you remove, has to be updated. 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