In Magento 2, We can easily display the address field. For this we need to use the following code
1. Create the customer_account_create.xml file on the path app/design/<Vendor>/<Theme>/Magento_Customer/layout.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?xml version="1.0"?> <!-- /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ --> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="customer_form_register"> <arguments> <argument name="show_address_fields" xsi:type="string">1</argument> </arguments> </referenceBlock> </body> </page> |
Now click on Register Page. Address fields are displayed on the page.
wow thank you this worked perfectly. Is there anyway to make the telephone number field a required field?
Thanks