Magento: Show address fields in account creation form
The Magento eCommerce platform hides the "address fields", including the customer's company name, by default. To enable them, most sources on the internet suggest overriding the register.phtml file and either commenting out the check to getShowAddressFields or to specifically call $this->setShowAddressFields (true);. That'll work, but it's not the proper way to do it. Read on the learn the proper way.
The default Magento account creation form does not allow the customer to enter his address information.
First, the quick answer. To enable the address fields, add the following to your app/design/frontend/default/template/layout/local.xml file:
<customer_account_create> <reference name="customer_form_register"> <action method="setShowAddressFields"><param>true</param></action> </reference> </customer_account_create>
Magento allows virtually all of its behaviour to be overridden by replacing modules or templates. Making a copy of a template (or worse: editing the ones included in the base package) is overkill for this case and will result in your custom template not being updated or the your changes being overwritten when Magento is updated.
For this reason, even though a simple call to $this->setShowAddressFields (true) would suffice, that should not be done through the template file. Instead, Magento provides a way to do such method calls through its local XML files. That is what happens in the XML snippet above.