Skip to content

Commit 3f12868

Browse files
author
Michael Yu
committed
MAGETWO-69657: Credit Card Information disappear after user enters promotion code
- Add self variable
1 parent 0f0f7bd commit 3f12868

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/payment-service.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ define([
2525
var freeMethod,
2626
filteredMethods,
2727
methodIsAvailable,
28-
methodNames;
28+
methodNames,
29+
self = this;
2930

3031
freeMethod = _.find(methods, function (method) {
3132
return method.method === freeMethodCode;
3233
});
33-
this.isFreeAvailable = !!freeMethod;
34+
self.isFreeAvailable = !!freeMethod;
3435

3536
if (freeMethod && quote.totals()['grand_total'] <= 0) {
3637
methods.splice(0, methods.length, freeMethod);
@@ -73,6 +74,7 @@ define([
7374
*/
7475
getAvailablePaymentMethods: function () {
7576
var allMethods = utils.copy(methodList()),
77+
grandTotalOverZero = quote.totals()['grand_total'] > 0,
7678

7779
/**
7880
* Free method filter
@@ -81,7 +83,7 @@ define([
8183
isFreeMethod = function (method) {
8284
return method.method === freeMethodCode;
8385
},
84-
grandTotalOverZero = quote.totals()['grand_total'] > 0;
86+
self = this;
8587

8688
if (!self.isFreeAvailable) {
8789
return allMethods;

0 commit comments

Comments
 (0)