0

I wanted to display customer address fields in register form. I have a custom extension, so I created the layout file in etc/config.xml:

<frontend>
    <layout>
        <updates>
            <[myextension]>
                <file>[myextension].xml</file>
            </[myextension]>
        </updates>
    </layout>
</frontend>

I followed this instruction: https://magento.stackexchange.com/a/53585/4276 and added the following line in app/design/frontend/base/default/layout/[myextension].xml

<customer_account_create>
    <reference name="customer_form_register">
        <action method="setData"><key>show_address_fields</key><value>1</value></action>
    </reference>
</customer_account_create>

But the address fields didn't show up. I tried following lines too with no luck:

<customer_account_create>
    <reference name="customer_form_register">
        <action method="setShowAddressFields">
            <param>true</param>
        </action>
    </reference>
</customer_account_create>

I'm using Magento CE 1.9.3.4. What should I do?

UPDATE

I looked into app/design/frontend/[mypackage]/[mytheme]/template/persistent/customer/form/register.phtml and the line if ($this->getShowAddressFields()): was there.

0

I've checked your code locally and it works fine. I can only recommend for you to check is your [myextension].xml really working (by adding/removing block or variable for it) and check is there another XML with setting negative value for show_address_fields.

  • The xml is loading. I could add a js file to the head. As far as I looked there are no xml or any other file setting the variable (I looked for both show_address_fields and setShowAddressFields). Do you have any more suggestions? – Pedram Behroozi Aug 26 '17 at 9:24

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.