INSERIR ENDERECO NO ATO DO CADASTRO DE USUARIO

De Tek-System Wiki
Ir para navegação Ir para pesquisar

Vá até

 vendor/magento/module-customer/view/frontend/layout/customer_account-create.xml
 

Voce deve adicionar o seguinte argument ao codigo

      <arguments>
          <argument name="show_address_fields" xsi:type="boolean">true</argument>
      </arguments>
 

Isto carregará todos os dados de endereço

Sua pagina deve ficar parecida com isto:

    ....
    ....
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceBlock name="head.components">
                <block class="Magento\Framework\View\Element\Js\Components" name="customer_account_create_head_components" template="Magento_Customer::js/components.phtml"/>
            </referenceBlock>
            <referenceContainer name="content">
                <block class="Magento\Customer\Block\Form\Register" name="customer_form_register" template="form/register.phtml">
                    <container name="form.additional.info" as="form_additional_info"/>
                    <container name="customer.form.register.fields.before" as="form_fields_before" label="Form Fields Before" htmlTag="div" htmlClass="customer-form-before"/>
                    
                    
                    <arguments>
                        <argument name="show_address_fields" xsi:type="boolean">true</argument>
                    </arguments>
    
    
                </block>
                <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
                    <arguments>
                        <argument name="triggers" xsi:type="array">
                            <item name="registerSubmitButton" xsi:type="string">.action.submit</item>
                        </argument>
                    </arguments>
                </block>
            </referenceContainer>
            <referenceContainer name="form.additional.info">
                <block class="Magento\Framework\View\Element\Template" name="form_additional_info_customer" template="Magento_Customer::additionalinfocustomer.phtml"/>
            </referenceContainer>
        </body>
    </page>
    ....
    ....