Add extra field(s) in registration page

Dear Tow…, this post is basically for new guys. Few guys asked me how to add extra field(s) in registration process. So, here I will try to give few technical tricks.

1. Add new fields in config xml (app\code\core\Mage\Customer\etc\config.xml). If you create new module then you can add this xml block in module config xml file. Create new module is the best practice and recommended 🙂

<?xml version="1.0"?>

     /* newly added field(s)*/

2. Add these extra field(s) in your respective theme registration.phtml (app\design\frontend\…\…\template\customer\form\registration.phtml). Keep the field name same as you mentioned in config.xml

3. To save extra data in database with customer registration process you have to add these extra field(s) as entity attribute in eav_attribute table. Here is sql script.

insert into `magento`.`eav_attribute` (`entity_type_id`, `attribute_code`, `attribute_model`, `backend_model`, `backend_type`, `backend_table`, `frontend_model`, `frontend_input`, frontend_label`, `frontend_class`, `source_model`, `is_required`, `is_user_defined`, `default_value`, `is_unique`, `note`)
values(1, 'accounttype', '', '', 'varchar', '', '', 'select', 'Account Type', '', '', 0, 0, '', 0,''),
        (1, 'companyname', '', '', 'varchar', '', '', 'text', 'Company Name', '', '', 0, 0, '', 0,'');

That’s all. Try and let me know if you face any complexity.

Like this you can add extra field(s) in any magento pages as well.


17 responses to “Add extra field(s) in registration page

  1. Oh great tutorial!!! It’s help me a lot to learn Magento.
    Also helps me to learn PHP, MySQL, CakePHP and Oracle with ready made code examples.

    Kelly Blue
    Web Developer, University of Technology, Sydney, Australia

  2. Hello, I used the code you have written but the problem that I ran into is that if I need to show the data in magento backend then what code would be used. Right now the front end is capturing the data in one extra field that we created and showing in database but not printing in magento backend.


    • which mysql table contains data for above code, I mean where does data go after getting inserted form newly created table, Am new to Magento

  3. So, how would I add a field (just like the gender field) to the admin side to show under the Account Information ? I added the xml code and the database code (similar to what the gender has) but the field doesn’t show up anywhere…


  4. HI,

    This has worked very well.. But I am unsure how to get the new collected data to show up on the manage customers section in the admin area?



  5. @Joe, I have the same trouble, Moinul can you help please?

  6. Hi! Everyone I want to add custom fields on the customer registration page by overriding the base classes not by editing the core files of magento can someone tell me how can i do this??????

    • Moinul Al-Mamun

      Create your own module as it override customer module and put your modified customer_account fieldsets xml block in etc/config.xml file. Hope it will work. For more help I remain. Thanks!

  7. HI! i have some problem in saving the values from my custom module i have created a customized registration page from which the values are not getting saved in backend can u please tell me whats the problem…..
    *__(‘Employee Id’) ?>

    <input type="text" name="employee_id" id="employee_id" value="htmlEscape($this->getFormData()->getEmployee_Id()) ?>” title=”__(‘Employee Id’) ?>” class=”input-text validate-employee_id required-entry”/>

  8. Hey , I want to show the new field with value in manage customers option backend. So how can i do that?

  9. I have try this but it’s not working on my end.
    I want to add new fields in merchant registration and also stored in the database , I am new in magento , when is the sql insert query code for merchant registration. please help me.

  10. hi, ty for the post.
    as everybody know, customer attributes can be a very helpful tool in marketing research of your eCommerce. Thanks to attributes you can know more about your customers and i resumed that they can help me increase my business profit. Firstly i manually added some attributes for registration page.
    One day my friend recommended me great solution for customers attributes, and i still use it.
    It is professional magento extension made by amasty.

    if you want know more about it your are welcome

  11. anyone whose code is working, plz can he/she post the code here? I don’t know where I’m making mistake.

  12. which mysql table contains data for above code, I mean where does data go after getting inserted form newly created table, Am new to Magento

  13. Laxman Prajapati

    Good and thanks 🙂

  14. Hello !!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s