FROM CACHE - en_header

Billing address state/province list setting

New Member
2 0 0


I am trying to pre-populate the billing address same as shipping address during checkout, as soon as the customer clicks on the 'different billing address' button. Everything works fine except for the province/state dropdown which is not generated correctly. Seems like this list is getting generated for each country when the onchange event occurs on the country list. By setting same country at the shipping phase, I am unable to let this trigger work and the province/state list is generated from the first entity present in the customers address book. Do you have any idea?

I tried this in checkout.liquid inside the {{ checkout_scripts }} section:


{{ '//' | script_tag }}
      $(document).ready(function() {
            $('.field--different-billing-address label').click();
            $("#checkout_billing_address_country option[data-code={{checkout.shipping_address.country_code}}]").attr('selected', 'selected'); 
            --> something I should do for the state/province dropdown list <--


Cheers, Erio

Replies 0 (0)