[-] MO : Fixed double creation of vouchers in loyalty and some redirections #PNM-1317

This commit is contained in:
Damien Metzger
2013-06-07 15:52:56 +02:00
parent 1688c7b0e6
commit 26608cea48
4 changed files with 49 additions and 43 deletions
@@ -112,10 +112,11 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController
$cart_rule->add();
// Register order(s) which contributed to create this voucher
LoyaltyModule::registerDiscount($cart_rule);
Tools::redirect($this->context->link->getModuleLink('loyalty', 'default', array('process' => 'summary')));
if (!LoyaltyModule::registerDiscount($cart_rule))
$cart_rule->delete();
}
Tools::redirect($this->context->link->getModuleLink('loyalty', 'default', array('process' => 'summary')));
}
/**