From 4bde02d4601ac76dc177289a72369107b229fc45 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Mon, 30 Jul 2012 14:35:59 +0000 Subject: [PATCH] [-] BO : you could not remove a gift once it had been set #PSCFV-3420 --- controllers/admin/AdminCartRulesController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index b0a21115b..e1a9a3562 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -104,6 +104,10 @@ class AdminCartRulesControllerCore extends AdminController if (!Tools::getValue($type.'_restriction')) $_POST[$type.'_restriction'] = 0; + // Remove the gift if the radio button is set to "no" + if (!(int)Tools::getValue('free_gift')) + $_POST['gift_product'] = 0; + // Retrieve the product attribute id of the gift (if available) if ($id_product = (int)Tools::getValue('gift_product')) $_POST['gift_product_attribute'] = (int)Tools::getValue('ipa_'.$id_product);