Wednesday, September 7, 2011

How to add address field in magento customer registration form?

If you want to add address details in your form you are in luck. Those fields are already setup in the "template/customer/form/register.phtml" file, but they are disabled by an inactive if statement that so far has not actually been linked to anything else in Magento. Therefore to enable the address related fields you simply need to comment out or delete the following statements:

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

and

<?php endif; ?>

Note that there are two occurrences of this if statement. One is around the area where the customer actually inputs their data  and the second statement is bottom of the file around some JavaScript code that sets up the State/Province select.

No comments:

Post a Comment