1

I want to show both the billing address and shipping address form in a user-registration page and save the data .

1 Answer 1

1

display address fields using customer_account_create.xml as below:

<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>

In template file already value set as 1 for both default_billing and default_shipping fields as 1, so by default billing and shipping, both addresses got to save the as same address.

vendor/magento/module-customer/view/frontend/templates/form/register.phtml

<input type="hidden" name="default_billing" value="1">
<input type="hidden" name="default_shipping" value="1">
3
  • here I can only save one address the address as default billing and default shipping i want two forms that one store as default billing and another one default shipping
    – jithin
    Commented Feb 20, 2020 at 5:15
  • Did you find any solution to achieve this ? Commented Nov 18, 2020 at 10:49
  • Its not working Commented Dec 20, 2021 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.