Adding new fields to Magento 1.7 registration form

Adding new fields to Magento 1.7 registration form

August 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Adding new fields to Magento 1.7 registration form

Adding Custom Fields to Magento 1.7 Registration Form

If you’re new to Magento development and struggling to add custom fields to the registration form on version 1.7, don’t worry! This guide will walk you through the process step-by-step. By following these instructions, you’ll be able to extend your customer’s profile with additional data.

Understanding the Registration Process

Before we dive into the code, let’s briefly understand how Magento handles user registration:

  1. The customer_register action in Mage_Customer_AccountController.php processes the form submission.
  2. It calls the createCustomer method of the customer model (Mage_Customer_Model_Customer).
  3. This method ultimately saves the new customer using the save method.

Adding a Custom Field to Customer Entity

Our first step is to add a new field to the customer entity:

  1. Navigate to app/code/core/Mage/Customer/etc/config.xml.
  2. Find the <fieldset> node inside the <global><models><customer> section.
  3. Add your custom field under this <fieldset>:
<fieldset>
    <legend>Customer Address Information</legend>
    <!-- Existing fields -->
    <custom_field>
        <label>New Custom Field</label>
        <input name="custom_field" type="text" />
        <backend_model>customer/attribute_backend_string</backend_model>
        <argument_help><![CDATA[]]></argument_help>
        <sort_order>50</sort_order>
    </custom_field>
</fieldset>

Replace custom_field with your desired field name.

Modifying the Registration Form

Next, we need to update the registration form template:

  1. Copy app/design/frontend/base/default/template/customer/form/register.phtml to your theme directory (e.g., app/design/frontend/YOUR_THEME/default/template/customer/form/register.phtml).
  2. Add the new field inside the <form action="" method="post"> block, before the existing fields:
<div class="field">
    <label for="custom_field" class="required"><em>*</em>New Custom Field:</label>
    <div class="input-box">
        <input type="text" name="custom_field" id="custom_field" />
    </div>
</div>

Saving the New Field

Finally, we need to ensure that our new field is saved correctly when a user registers:

  1. Override the createCustomer method in your custom module (if you haven’t created one yet, follow this guide).
  2. In your overridden method, add the following code before the line $customer = Mage::getModel('customer/customer')->setId(null);:
$customFieldData = $data->getCustomField();
if ($customFieldData !== null && $customFieldData != '') {
    $customer->setCustomField($customFieldData);
}

Replace custom_field with your field name.

Conclusion

Adding custom fields to the Magento 1.7 registration form requires a combination of modifying the customer entity, updating the form template, and ensuring the new data is saved correctly. By following this guide, you should now be able to extend your customers’ profiles with additional information tailored to your store’s needs.

Remember that Magento development often involves editing core files, which can cause issues during updates. Always keep a backup of your code and consider using a child theme for modifications to avoid conflicts.

For more advanced topics in Magento 1.x development, I recommend exploring the Laravel Company blog, where we regularly publish tutorials and best practices to help you become a proficient Magento developer.

Magento 1 Admin Configuration Orders

Our network