Skip to content

Commit

Permalink
Checkout: Fix error when wc_address_i18n_params does not have data fo…
Browse files Browse the repository at this point in the history
…r a given country (#9974)
  • Loading branch information
danielmx-dev authored and frosso committed Dec 17, 2024
1 parent 940ea23 commit ef9bd6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-allow-addresses-from-woo-supported-countries
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Checkout: Fix error when wc_address_i18n_params does not have data for a given country
4 changes: 2 additions & 2 deletions client/checkout/classic/event-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ jQuery( function ( $ ) {
if ( country && locale && fieldName !== 'billing_email' ) {
const key = fieldName.replace( 'billing_', '' );
isRequired =
locale[ country ][ key ]?.required ??
locale.default[ key ]?.required;
locale[ country ]?.[ key ]?.required ??
locale.default?.[ key ]?.required;
}

const hasValue = $field?.value;
Expand Down

0 comments on commit ef9bd6c

Please sign in to comment.