Show address fields on Magento customer registration page

There’s no setting in Magento’s backend to switch on/off address fields display on customer registration page. The easiest way to show address fields is to add a ‘show_address_fields’ argument to the layout file customer_account_create.xml

File: app/design/frontend//Magento_Customer/layout/customer_account_create.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_form_register">
            <arguments>
                <argument name="show_address_fields" xsi:type="number">1</argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Clear cache afterwards and the address fields should appear on the customer account creation page.

Leave a Reply

Your email address will not be published. Required fields are marked *