2

I created the module name "Name_Module", Now I want to change the order (position) to " create customer account form fields ". How could I achieve this functionality?

Also, need to check if the module is enabled then change the order(position).

Thanks in advance.

  • What you want to change in it? – Kamal Paliwal Feb 15 at 7:12
  • need to change the position of the fields. – Utsav Gupta Feb 15 at 7:20
  • Customer Registration Form Or Customer Account Information Form ?? – Dhairya Shah Feb 15 at 7:22
  • Customer Registration form – Utsav Gupta Feb 15 at 7:23
  • 1
    <referenceBlock name="customer_form_register"> <action method="setTemplate" ifconfig="name/module/enabled"> <argument name="template" xsi:type="string">CompanyName_Moduelname::form.phtml</argument> </action> </referenceBlock> – Dhairya Shah Feb 15 at 7:32
1

You will need to override template file of:

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

Create a layout file:

CompanyName/ModuleName/view/frontend/layout/customer_account_create.xml

<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="customer_form_register" ifconfig="section/group/enable>
            <action method="setTemplate">
                <argument name="template" xsi:type="string">CompanyName_ModuleName::form/register.phtml</argument>
            </action>
        </referenceBlock>     
    </body> 
</page>

Template File Path:

CompanyName/ModuleName/view/frontend/templates/form/register.phtml

  • @UtsavGupta If my answer solved your problem, click the big checkbox to accept it as the answer. – Dhairya Shah Feb 15 at 9:20

Your Answer

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

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