From e8cef6aea04dc37f5e29ec23f2e5d7b0b28a0628 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Thu, 20 Sep 2012 11:52:06 +0000 Subject: [PATCH] [-] BO : fixed combination of cart rules when saving the rule #PSCFV-4147 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17433 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminCartRulesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index 0bf11f324..4ca55f874 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -195,7 +195,7 @@ class AdminCartRulesControllerCore extends AdminController } // If the new rule has no cart rule restriction, then it must be added to the white list of the other cart rules that have restrictions - if ($currentObject->cart_rule_restriction == 0) + if (!Tools::getValue('cart_rule_restriction')) { Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'cart_rule_combination` (`id_cart_rule_1`, `id_cart_rule_2`) ( @@ -209,6 +209,7 @@ class AdminCartRulesControllerCore extends AdminController SELECT cr.id_cart_rule FROM '._DB_PREFIX_.'cart_rule cr WHERE cr.id_cart_rule != '.(int)$currentObject->id.' + AND cr.cart_rule_restriction = 0 AND cr.id_cart_rule NOT IN ( SELECT IF(id_cart_rule_1 = '.(int)$currentObject->id.', id_cart_rule_2, id_cart_rule_1) FROM '._DB_PREFIX_.'cart_rule_combination