I want to add country-state functionality to the customer registration form and how to save it
1 Answer
Add below code in your customer_account_create.xml file. This Will add all Address Fields in Registration Form in frontend only
<?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>
-
then how to get this value as a customer attribute for add field in customer account information in admin side? Jun 5 at 9:05
-
I want to add functionality for a country region in the customer account information section Jun 5 at 9:07
-
You can't access this value as a customer attribute. You have to access these values as simply Magento did for accessing address values. Jun 6 at 7:48
-
-