Magento provides a simple user account signup page. However, some online stores might want to collect relevant customer information for more targeted and personal interactions with their customers. Some examples of details that could be collected include shoe size, clothing size or favourite colour.
Adding your custom fields on the signup form is not difficult, but it is not trivial either, since one cannot use the Magento backend for the task. As an example of how it can be done, I will demonstrate the addition of a new custom field to the signup form asking new users to enter their favourite ice cream flavour.
We need to make a module to extend the functionality of the customer model. Start by adding the module xml file to the
app/etc/modules/directory. You need to decide on a module name. In this example we will use the Fontis scope, and call the module 'Customer'. Therefore we need to create a file named
Fontis_Customer.xmland add the following content:
<config> <modules> <Fontis_Customer> <active>true</active> <codePool>local</codePool> </Fontis_Customer> </modules> </config>
Adding the above file means that Magento is now aware of a new custom module. Now, we need to create the module itself, which must be located in the
app/code/local/Fontis/Customerdirectory. Inside this directory, create an
etcdirectory and copying the following file inside:
Edit the file and change :
<modules> <Mage_Customer> <version>x.x.x</version> </Mage_Customer> </modules>
<modules> <Fontis_Customer> <version>1.0.0</version> </Fontis_Customer> </modules>
This file contains two different
<fieldsets>- one in
<config><admin>and one in
<config><global>. At the end of the second one,