Magento Logo

Enable Address Fields in Magento Customer Registration Forms

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 🙂

6 thoughts on “Enable Address Fields in Magento Customer Registration Forms

  1. Patrick

    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.

    Reply
  2. majid

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

    Reply

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.