diff --git a/ajax/frontend/redeem.php b/ajax/frontend/redeem.php index 9eef1397aff97c73c1282aecc964ca6ec99b235e..02f080a8f32945d945c73b939bde4d09374b48bb 100644 --- a/ajax/frontend/redeem.php +++ b/ajax/frontend/redeem.php @@ -32,9 +32,7 @@ function ($code, $orderHash) { } catch (QUI\ERP\Coupons\CouponCodeException $Exception) { QUI\System\Log::writeDebugException($Exception); -// QUI::getMessagesHandler()->addError($Exception->getMessage()); throw $Exception; -// return false; } catch (Exception $Exception) { QUI\System\Log::writeException($Exception); @@ -42,15 +40,6 @@ function ($code, $orderHash) { 'quiqqer/coupons', 'message.ajax.general_error' ]); - -// QUI::getMessagesHandler()->addError( -// QUI::getLocale()->get( -// 'quiqqer/coupons', -// 'message.ajax.general_error' -// ) -// ); - -// return false; } $Order = QUI\ERP\Order\Handler::getInstance()->getOrderByHash($orderHash); @@ -67,15 +56,6 @@ function ($code, $orderHash) { 'quiqqer/coupons', 'exception.CouponCode.discounts_invalid' ]); - -// QUI::getMessagesHandler()->addError( -// QUI::getLocale()->get( -// 'quiqqer/coupons', -// 'exception.CouponCode.discounts_invalid' -// ) -// ); -// -// return false; } if ($Discount->getAttribute('scope') === QUI\ERP\Discount\Handler::DISCOUNT_SCOPE_GRAND_TOTAL) { @@ -84,15 +64,6 @@ function ($code, $orderHash) { 'quiqqer/coupons', 'exception.CouponCode.discounts_invalid' ]); - -// QUI::getMessagesHandler()->addError( -// QUI::getLocale()->get( -// 'quiqqer/coupons', -// 'exception.CouponCode.discounts_invalid' -// ) -// ); -// -// return false; } continue; @@ -103,15 +74,6 @@ function ($code, $orderHash) { 'quiqqer/coupons', 'exception.CouponCode.discounts_invalid' ]); - -// QUI::getMessagesHandler()->addError( -// QUI::getLocale()->get( -// 'quiqqer/coupons', -// 'exception.CouponCode.discounts_invalid' -// ) -// ); -// -// return false; } } @@ -133,8 +95,6 @@ function ($code, $orderHash) { if ($Order instanceof QUI\ERP\Order\OrderInProcess) { $CouponCode->addToOrder($Order); } - -// return true; }, ['code', 'orderHash'] ); diff --git a/bin/frontend/classes/CouponCodes.js b/bin/frontend/classes/CouponCodes.js index cea109e7435069d43307de925ac0f89ba75d3917..d0076baeb5067a80b66e66018dd670fc84651ae2 100644 --- a/bin/frontend/classes/CouponCodes.js +++ b/bin/frontend/classes/CouponCodes.js @@ -32,7 +32,8 @@ define('package/quiqqer/coupons/bin/frontend/classes/CouponCodes', [ 'package': pkg, code: code, orderHash: orderHash, - onError: reject + onError: reject, + showError: false // disable quiqqer message in frontend }); }); } diff --git a/bin/frontend/controls/CouponCodeInput.js b/bin/frontend/controls/CouponCodeInput.js index 174c5c509ba8a73809c61c9ddf4ec5a8fc2f5df0..df764ed84edf1bec1342f190168a916b39e88228 100644 --- a/bin/frontend/controls/CouponCodeInput.js +++ b/bin/frontend/controls/CouponCodeInput.js @@ -219,22 +219,6 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [ OrderProcess.Loader.show(); - // OrderProcess.getOrder().then(function(orderHash) { - // return CouponCodes.addCouponCodeToBasket(code, orderHash); - // }).then(function(redeemed) { - // self.$running = false; - // - // if (redeemed === false) { - // OrderProcess.Loader.hide(); - // self.Loader.hide(); - // return; - // } - // - // self.$addCouponCodeToSession(code).then(function() { - // OrderProcess.reload(); - // }); - // }); - OrderProcess.getOrder().then(function(orderHash) { CouponCodes.addCouponCodeToBasket(code, orderHash).then(() => { self.$running = false; @@ -244,7 +228,6 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [ }); }).catch((err) => { OrderProcess.Loader.hide(); - self.Loader.hide(); self.handleError(err); }); });