0

I'm trying to move address fields to a custom form that I created.

In app/design/frontend/vendor/theme/Magento_Customer/layout/customer_account_create.xml I have the following code:

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

And this is my block in

/app/code/Vendor/Module/view/frontend/layout/selle_index_index.xml


<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Form</title>
    </head>
    <body>
        <referenceContainer name="content">
            <block name="form" class="Magento\Framework\View\Element\Template" template="Venddor_Module::form.phtml"/>

        </referenceContainer>

    </body>
</page> 
  • You should learn, how to override layout in Magento 2. – MichaelHa Sep 7 at 10:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.