Skip to content

Commit

Permalink
Set store location when no country is selected on block checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuesken committed Jan 27, 2025
1 parent c2981ac commit eb9edc9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions resources/js/blocks/molliePaymentMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ function setAvailableGateways(country, currencyCode, data) {
saveCachedAvailableGateways();
}
function useMollieAvailableGateways(billing, currencyCode, cartTotal, filters, ajaxUrl, jQuery, item) {
const country = billing.country;
let country = billing.country;
const code = currencyCode;
const value = cartTotal;

if (!country) {
country = wcSettings?.baseLocation.country;
}

wp.element.useEffect(() => {
if (!country || !item) return;
Expand Down Expand Up @@ -416,7 +418,10 @@ const molliePaymentMethod = (useEffect, ajaxUrl, filters, gatewayData, available
}
loadCachedAvailableGateways();
const currencyCode = cartTotals?.currency_code;
const country = billingData?.country;
let country = billingData?.country;
if (!country) {
country = wcSettings?.baseLocation.country;
}
const currentFilterKey = currencyCode + "-" + country;

creditcardSelectedEvent();
Expand Down

0 comments on commit eb9edc9

Please sign in to comment.