How to create new fields for customer

How to create new fields for customer

October 10, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to create new fields for customer

Creating New Customer Fields in Magento 1.6: A Comprehensive Guide

As an experienced web developer working primarily with Laravel-based projects for Laravel Company (https://laravelcompany.com), I frequently encounter questions about customizing the customer registration process on Magento platforms, such as the issue raised about Magento version 1.6.

Understanding the Change in Magento 1.6

Before diving into the solution, it’s important to understand why the approach for creating new customer fields changed from Magento 1.5 to 1.6.

The primary reason is that Magento 1.6 introduced a significant architectural change with its EAV (Entity-Attribute-Value) model. This model separates data storage from the entity itself, allowing for more flexible and scalable attribute management. However, this also means that adding new customer attributes requires a different setup process than in earlier versions.

Step-by-Step: Adding New Customer Fields

Here is a step-by-step guide to creating new fields for the customer registration form in Magento 1.6:

  1. Create a Database Setup File First, create a new file under app/code/core/Mage/Customer/sql/customer_setup/install-0.7.0.sql. This will contain your database setup script.

  2. Define Your New Attribute In the install-0.7.0.sql file, you need to define your new attribute using the following syntax:

    CREATE TABLE `customer_entity_varchar` (
      `entity_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
      `attribute_id` smallint(5) unsigned NOT NULL default '0',
      `store_id` smallint(5) unsigned NOT NULL default '0',
      `entity_type_id` varchar(32) NOT NULL,
      `value` varchar(255) DEFAULT NULL,
      PRIMARY KEY (`entity_id`, `attribute_id`, `store_id`)
    );
    

    Replace the column names and sizes as required for your specific field. The entity_type_id should always be ‘customer’.

  3. Create the New Attribute in Magento Next, create a new attribute file under app/code/core/Mage/Customer/etc/config.xml. Add the following code within the <config> tags:

    <customer>
      <entities>
        <customer_attribute>
          <code>my_new_field</code>
          <sort_order>200</sort_order>
          <label>My New Field</label>
          <visible>1</visible>
          <required>0</required>
          <user_defined>true</user_defined>
        </customer_attribute>
      </entities>
    </customer>
    
  4. Update the Customer Form Finally, update your customer form templates under app/design/frontend/base/default/template/customer/form/register.phtml and register.phtml. Add a new input field corresponding to your attribute.

Common Pitfalls and Best Practices

Conclusion

While there are differences in the process for adding new customer fields between Magento 1.5 and 1.6, the core principles remain consistent: define your attribute in the database, configure it in the XML files, and update your form templates accordingly.

At Laravel Company (https://laravelcompany.com), we’ve found that understanding and working with Magento’s EAV model is key to successfully managing customer attributes and data flexibility. With this guide, you should be able to create new fields for your Magento 1.6 customers with confidence.

Magento 1 Database Customers Pricing

Our network