[-] 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
This commit is contained in:
@@ -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 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('
|
Db::getInstance()->execute('
|
||||||
INSERT INTO `'._DB_PREFIX_.'cart_rule_combination` (`id_cart_rule_1`, `id_cart_rule_2`) (
|
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
|
SELECT cr.id_cart_rule
|
||||||
FROM '._DB_PREFIX_.'cart_rule cr
|
FROM '._DB_PREFIX_.'cart_rule cr
|
||||||
WHERE cr.id_cart_rule != '.(int)$currentObject->id.'
|
WHERE cr.id_cart_rule != '.(int)$currentObject->id.'
|
||||||
|
AND cr.cart_rule_restriction = 0
|
||||||
AND cr.id_cart_rule NOT IN (
|
AND cr.id_cart_rule NOT IN (
|
||||||
SELECT IF(id_cart_rule_1 = '.(int)$currentObject->id.', id_cart_rule_2, id_cart_rule_1)
|
SELECT IF(id_cart_rule_1 = '.(int)$currentObject->id.', id_cart_rule_2, id_cart_rule_1)
|
||||||
FROM '._DB_PREFIX_.'cart_rule_combination
|
FROM '._DB_PREFIX_.'cart_rule_combination
|
||||||
|
|||||||
Reference in New Issue
Block a user