From eb423f1a094d9f2fdc991e802cc0467aa1c331ed Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Fri, 14 Dec 2012 09:48:16 +0100 Subject: [PATCH] [-] BO : fixed duplicate code management on cart rules #PSCFV-6119 --- controllers/admin/AdminCartRulesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index f2d79a266..b381ea57b 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -126,7 +126,7 @@ class AdminCartRulesControllerCore extends AdminController $this->errors[] = Tools::displayError('Reduction percent must be between 0% and 100%'); if ((int)Tools::getValue('reduction_amount') < 0) $this->errors[] = Tools::displayError('Reduction amount cannot be lower than 0'); - if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code')))) + if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code'))) && $same_code != Tools::getValue('id_cart_rule')) $this->errors[] = sprintf(Tools::displayError('This cart rule code is already used (conflict with cart rule %d)'), $same_code); }