From 0be7304b1159878784a1446d7dd48c18cad7975b Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Wed, 16 Jul 2025 12:36:53 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Make=20the=20state=20shippin?= =?UTF-8?q?g=20address=20data=20optional=20in=20the=20Fastlane=20Block=20C?= =?UTF-8?q?heckout=20to=20fix=20non=20US-CA=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/ppcp-axo-block/resources/js/helpers/fieldHelpers.js | 2 +- .../resources/js/hooks/useShippingAddressChange.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-axo-block/resources/js/helpers/fieldHelpers.js b/modules/ppcp-axo-block/resources/js/helpers/fieldHelpers.js index c04b62a24..d7064e004 100644 --- a/modules/ppcp-axo-block/resources/js/helpers/fieldHelpers.js +++ b/modules/ppcp-axo-block/resources/js/helpers/fieldHelpers.js @@ -121,7 +121,7 @@ export const populateWooFields = ( address_1: address.addressLine1, address_2: address.addressLine2 || '', city: address.adminArea2, - state: address.adminArea1, + state: address.adminArea1 || '', postcode: address.postalCode, country: address.countryCode, phone: phoneNumber.nationalNumber, diff --git a/modules/ppcp-axo-block/resources/js/hooks/useShippingAddressChange.js b/modules/ppcp-axo-block/resources/js/hooks/useShippingAddressChange.js index 2c45b8930..d22904ab0 100644 --- a/modules/ppcp-axo-block/resources/js/hooks/useShippingAddressChange.js +++ b/modules/ppcp-axo-block/resources/js/hooks/useShippingAddressChange.js @@ -32,7 +32,7 @@ export const useShippingAddressChange = ( fastlaneSdk, setShippingAddress ) => { address_1: address.addressLine1, address_2: address.addressLine2 || '', city: address.adminArea2, - state: address.adminArea1, + state: address.adminArea1 || '', postcode: address.postalCode, country: address.countryCode, phone: phoneNumber.nationalNumber, From bb04e0ebe802058f1af6f8fd848e8d8366ece011 Mon Sep 17 00:00:00 2001 From: Daniel Dudzic Date: Wed, 16 Jul 2025 12:45:59 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Make=20the=20state=20data=20?= =?UTF-8?q?optional=20in=20the=20Fastlane=20Classic=20Checkout=20to=20fix?= =?UTF-8?q?=20non=20US-CA=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/ppcp-axo/resources/js/Views/ShippingView.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/ppcp-axo/resources/js/Views/ShippingView.js b/modules/ppcp-axo/resources/js/Views/ShippingView.js index 4853659b7..1b3cbd94f 100644 --- a/modules/ppcp-axo/resources/js/Views/ShippingView.js +++ b/modules/ppcp-axo/resources/js/Views/ShippingView.js @@ -44,7 +44,7 @@ class ShippingView { ? this.states[ countryCode ][ stateCode ] : stateCode; - if ( this.hasEmptyValues( data, stateName ) ) { + if ( this.hasEmptyValues( data ) ) { return `
@@ -71,9 +71,9 @@ class ShippingView { ) }
${ data.value( 'street1' ) }
${ data.value( 'street2' ) }
-
${ data.value( - 'city' - ) }, ${ stateName } ${ data.value( 'postCode' ) }
+
${ data.value( 'city' ) }${ + stateName ? ', ' + stateName : '' + } ${ data.value( 'postCode' ) }
${ valueOfSelect( '#billing_country', countryCode @@ -158,14 +158,13 @@ class ShippingView { } ); } - hasEmptyValues( data, stateName ) { + hasEmptyValues( data ) { return ( ! data.value( 'email' ) || ! data.value( 'firstName' ) || ! data.value( 'lastName' ) || ! data.value( 'street1' ) || - ! data.value( 'city' ) || - ! stateName + ! data.value( 'city' ) ); }