Online store owners tend to collect maximum customer information which can be used for marketing purposes and improve the customer experience.
Registration form is best for collecting maximum data which can be used further for business requirements.
The default Magento 2 registration form allows admin to collect customer data such as:
- Name and last name
- date of birth
- middle name
- Telephone
- Fax
Note, In Magento 2, the Show or we can say Enable Middle Name in Registration Form is an optional field, also you can add date of birth in registration form as an customer attribute.
However, it may not be enough for every business with various requirements.
One important detail about the customer is their address. A store owner can show address fields in registration form in Magento 2 to collect the location details and use it in designing the marketing strategy.
In addition to collecting address details, it is crucial for store owners to show Tax/VAT Number in Registration Form in Magento 2 as it helps in complying with tax regulations and building trust with customers by displaying transparency in pricing.
For instance, if your store is selling apparels, it’s a waste of time to send notification of winter clothes(Jackets, scarf, gloves) to the customers living in a hot climate!
Also, the address detail is essential if your business is delivering physical products.
Use the below solution to display address fields in the Magento 2 sign up form.
The registration form in the default Magento 2 looks something like this:

Now, we’ll see how to add the address fields in this form.
Method to Show Address Fields in Registration Form in Magento 2
Add below code in your customer_account_create.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"> <arguments> <argument name="show_address_fields" xsi:type="boolean">true</argument> </arguments> </referenceBlock> </body> </page>
After applying the solution, the custom sign up form displays the address field as shown here:

That’s it! Also to prevent yourself from multiple form submission and storing same data of same user, once clicked on submit button Magento 2 disable submit button on form submission.
You can also add or remove address field from PDF in Magento 2 as per your requirements.
Please do consider sharing this post with Magento Community via social media.
Thank You.
Also Read: