[-] MO : Fixed double creation of vouchers in loyalty and some redirections #PNM-1317
This commit is contained in:
@@ -42,7 +42,7 @@ if (!$context->customer->isLogged())
|
||||
|
||||
$context->controller->addJqueryPlugin(array('dimensions', 'cluetip'));
|
||||
|
||||
$customerPoints = (int)(LoyaltyModule::getPointsByCustomer((int)($cookie->id_customer)));
|
||||
$customerPoints = (int)LoyaltyModule::getPointsByCustomer((int)$cookie->id_customer);
|
||||
|
||||
/* transform point into voucher if needed */
|
||||
if (Tools::getValue('transform-points') == 'true' AND $customerPoints > 0)
|
||||
@@ -99,7 +99,8 @@ if (Tools::getValue('transform-points') == 'true' AND $customerPoints > 0)
|
||||
$cartRule->add();
|
||||
|
||||
/* Register order(s) which contributed to create this voucher */
|
||||
LoyaltyModule::registerDiscount($cartRule);
|
||||
if (!LoyaltyModule::registerDiscount($cartRule))
|
||||
$cartRule->delete();
|
||||
|
||||
Tools::redirect('modules/loyalty/loyalty-program.php');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user