Skip to content

Commit

Permalink
Refresh cart totals when selecting a payment method
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin committed Sep 1, 2021
1 parent 9bb54e7 commit d4d8aaf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions resources/js/components/Checkout/Checkout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@
return validated
},
async selectPaymentMethod() {
let response = await this.magentoCart('post', 'set-payment-information', {
email: this.user == null ? this.$root.guestEmail : this.user.email,
paymentMethod: {
method: this.checkout.payment_method
}
})
this.getTotalsInformation()
},
async savePaymentMethod() {
if (!this.checkout.payment_method) {
Notify(window.config.translations.checkout.no_payment_method, 'error')
Expand Down Expand Up @@ -284,6 +294,9 @@
this.storeShipping()
}
},
'checkout.payment_method': function () {
this.selectPaymentMethod()
},
'checkout.step': function () {
if (this.backEvent) {
this.backEvent = false;
Expand Down

0 comments on commit d4d8aaf

Please sign in to comment.