Skip to content

Commit

Permalink
fix radio button
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkittisak committed Jun 28, 2024
1 parent 55a95ce commit fa3e7a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ define(
'Magento_Payment/js/model/credit-card-validation/validator',
'Magento_Checkout/js/model/full-screen-loader',
'Magento_Checkout/js/action/redirect-on-success',
'Magento_Checkout/js/model/quote'
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/checkout-data',
'Magento_Checkout/js/action/select-payment-method'
],
function (
ko,
Expand All @@ -19,7 +21,9 @@ define(
validator,
fullScreenLoader,
redirectOnSuccessAction,
quote
quote,
checkoutData,
selectPaymentMethodAction
) {
'use strict'

Expand Down Expand Up @@ -87,6 +91,8 @@ define(

selectPaymentMethod: function () {
this._super();
selectPaymentMethodAction(this.getData());
checkoutData.setSelectedPaymentMethod(this.item.method);
OmiseCard.destroy();
setTimeout(() => {
if (this.isSecureForm()) {
Expand All @@ -97,7 +103,7 @@ define(
}
}, 300);

return this
return true
},

isSecureForm: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ define(
'Magento_Catalog/js/price-utils',
'Magento_Checkout/js/model/full-screen-loader',
'mage/storage',
'Magento_Checkout/js/checkout-data',
'Magento_Checkout/js/action/select-payment-method'
],
function (
$,
Expand All @@ -17,7 +19,9 @@ define(
quote,
priceUtils,
fullScreenLoader,
storage
storage,
checkoutData,
selectPaymentMethodAction
) {
'use strict';
const CAPTION = $.mage.__('Choose number of monthly payments');
Expand Down Expand Up @@ -142,14 +146,16 @@ define(

selectPaymentMethod: function () {
this._super();
selectPaymentMethodAction(this.getData());
checkoutData.setSelectedPaymentMethod(this.item.method);
OmiseCard.destroy();
setTimeout(() => {
const element = document.querySelector('.omise-installment-form')
if(element) {
this.applyOmiseJsToElement(this, element);
}
}, 300);
return this
return true
},

openOmiseJs: function () {
Expand Down

0 comments on commit fa3e7a1

Please sign in to comment.