Skip to content

Commit f758758

Browse files
dyushkinviktym
authored andcommitted
MC-19515: Cart price rule based on payment methods not applied in checkout
1 parent c2b3345 commit f758758

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/action/select-payment-method.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
* @api
88
*/
99
define([
10-
'../model/quote'
11-
], function (quote) {
10+
'Magento_Checkout/js/model/quote',
11+
'Magento_SalesRule/js/model/payment/discount-messages',
12+
'Magento_Checkout/js/action/set-payment-information',
13+
'Magento_Checkout/js/action/get-totals'
14+
], function (quote, messageContainer, setPaymentInformationAction, getTotalsAction) {
1215
'use strict';
1316

1417
return function (paymentMethod) {
@@ -18,5 +21,15 @@ define([
1821
};
1922
}
2023
quote.paymentMethod(paymentMethod);
24+
setPaymentInformationAction(
25+
messageContainer,
26+
{
27+
method: paymentMethod.method
28+
}
29+
);
30+
31+
if (quote.totals()['coupon_code']) {
32+
getTotalsAction([]);
33+
}
2134
};
2235
});

0 commit comments

Comments
 (0)