Enable Address Fields in Magento Customer Registration Forms

Magento Logo

In order to enable address fields in Magento customer registration forms you only need to enable the attribute setShowAddressField.

To do so either add the following in your template or in the base local.xml (/app/design/frontend/base/default/layout/local.xml):

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

As always, make sure to reload your cache afterwards. This setting will enable to execution of

<?php if($this->getShowAddressFields()): ?>

in register.phtml (/app/design/frontend/base/default/template/customer/form/register.phtml). That’s it 🙂

Comments

6 responses to “Enable Address Fields in Magento Customer Registration Forms”

  1. Giel Berkers Avatar

    Thanks for the tip! Good to see it is this easy!

  2. suresh Avatar
    suresh

    Nice , very usefull

  3. Sabina Oražem Avatar
    Sabina Oražem

    Thank you, this is great. 😉

  4. Patrick Avatar

    Great Tip, worked a treat, I had a little issue as I needed to apply a child theme as we run multi-store, however once i copied the local.xml to the child theme and added the above code it enabled for that store no problem.

    One question though, in the situation above can you just add a new local.xml with the extra code into your child theme or do you need to copy the whole thing, i.e. will it read the snippet in the child theme and the the rest from the main theme or do you need the whole of layout.xml in the child.

  5. Bharti Avatar
    Bharti

    Great !! Thanks for the help 🙂 .

  6. majid Avatar

    how just get telephone field in customer register page?
    this solution show all address fields but i just need telephone

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.