Magento2

If you want to show customer address fields on registration form page. Than you need to set true to show.address.fields in your customer_account_create.xml. See Below Steps for this example:

1). First you need to Create below file in your custom theme:

app/design/frontend/Select_theme_folder/Magento_Customer/layout/customer_account_create.xml

2). Now put below code in this xml file.

<?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">
            <action method="setShowAddressFields">
                <argument name="show.address.fields" xsi:type="boolean">true</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Now save this file. and run below commands:
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean

Hope this will helps you!

Leave a Reply

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