Magento 2.4.3 – Changing the Order of Fields in Customer Address Book

customer-addressmagento2.4.3

I would like to change the order of fields when a customer adds an address or edits an existing one in the address book.

Eg: I would like the zip-code field to be ordered before the city field.

Previously I had already handled this by copying the contents from magento-customer/view/frontend/templates/form/edit.phtml
and pasting them into my-theme/Magento_Customer/templates/address/edit.phtml.

I can still use this method to completely omit certain fields from the form but I can not control the order of the fields in this way any more.

Do I need to also create a layout file since the new Magento update or something?

Best Answer

You can also update sorting customer address field from database table. you will update table customer_eav_attribute field sort_order. update query like below for zipcode show before city.

UPDATE `customer_eav_attribute` SET `sort_order` = '75' WHERE `customer_eav_attribute`.`attribute_id` = 33;