1

I am working on magento 2.1.3

I want to change the sort order of shipping address form elements Country State and City in checkout page.

Country should load first then State and finally city

1

Finally i got answer for this

Edit following file

app/design/frontend/Vendor/theme/Magento_Checkout/layout/checkout_index_index.xml

and put like this

 <body>   
 <referenceBlock name="checkout.root">
 <arguments>
    <argument name="jsLayout" xsi:type="array">
       <item name="components" xsi:type="array">
                <item name="checkout" xsi:type="array">
                    <item name="children" xsi:type="array">
                        <item name="steps" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="shipping-step" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shippingAddress" xsi:type="array">

                                            <item name="children" xsi:type="array">
                                                <item name="shipping-address-fieldset" xsi:type="array">
                                                    <item name="children" xsi:type="array">

                                                        <item name="postcode" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">80</item>
                                                        </item>


                                                        <item name="country_id" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">85</item>
                                                        </item>
                                                        <item name="region_id" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">87</item>
                                                        </item>
                                                        <item name="city" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">88</item>
                                                        </item>
                                                        <item name="telephone" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">90</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </item>
            </item>
        </argument>
    </arguments>
</referenceBlock>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.