[-] BO : you could not remove a gift once it had been set #PSCFV-3420

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16606 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-07-30 14:35:59 +00:00
parent ee34eeab59
commit 121d9abc2c
@@ -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);