Merge pull request #21733 from woocommerce/fix/21642
Trigger a country select change on initial load
This commit is contained in:
commit
7d7e49bd8d
|
@ -6,8 +6,7 @@ jQuery( function( $ ) {
|
|||
return false;
|
||||
}
|
||||
|
||||
var locale_json = wc_address_i18n_params.locale.replace( /"/g, '"' ),
|
||||
locale = $.parseJSON( locale_json );
|
||||
var locale_json = wc_address_i18n_params.locale.replace( /"/g, '"' ), locale = $.parseJSON( locale_json );
|
||||
|
||||
function field_is_required( field, is_required ) {
|
||||
if ( is_required ) {
|
||||
|
@ -27,11 +26,8 @@ jQuery( function( $ ) {
|
|||
}
|
||||
}
|
||||
|
||||
$( document.body )
|
||||
|
||||
// Handle locale
|
||||
.bind( 'country_to_state_changing', function( event, country, wrapper ) {
|
||||
|
||||
$( document.body ).bind( 'country_to_state_changing', function( event, country, wrapper ) {
|
||||
var thisform = wrapper, thislocale;
|
||||
|
||||
if ( typeof locale[ country ] !== 'undefined' ) {
|
||||
|
@ -129,4 +125,7 @@ jQuery( function( $ ) {
|
|||
rows.detach().appendTo( wrapper );
|
||||
} );
|
||||
});
|
||||
|
||||
// Make sure the locales are loaded on first page load.
|
||||
$( '#billing_country' ).trigger( 'change' );
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue