3

I want move this input to this, it is suffix input. I use this code but it not work in billing address. I created module and followed https://inchoo.net/magento-2/frontend/reorder-input-fields-shipping-billing-step-magento-2/ but it not work for me.

Please help me.

My code in checkout_index_index of my theme

<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="prefix" xsi:type="array">
                            <item name="sortOrder" xsi:type="string">1</item>
                        </item>
                        <item name="suffix" xsi:type="array">
                            <item name="sortOrder" xsi:type="string">2</item>
                        </item>
                    </item>
                </item>
            </item>
        </item>
    </item>
</item>

enter image description here

2

1 Answer 1

4

Above code is for the Shipping address. For the billing address, we had to add a check depending on the checkout configuration in admin about where to display the billing address, on the payment method or payment page, as then the array keys are different.

So the shipping address fields will be shown like below in checkout.

Check detailed information on https://www.magevision.com/blog/post/change-order-of-address-fields-in-checkout-magento-2/

4
  • if i want reorder suffix name input, can i change telephone -> suffix ?
    – TN98
    Sep 5, 2019 at 5:05
  • I'm not sure about this, you can try it.
    – Sumit
    Sep 5, 2019 at 5:06
  • It work for me, thank you very much.
    – TN98
    Sep 5, 2019 at 5:11
  • Good to hear... You're welcome.
    – Sumit
    Sep 5, 2019 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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