I have been looking into some tutorials but none of them works, for example, first they told me to open xxx files and edit something but what I found on my files is just a class with no single method inside it.

Currently I have got register.phtml(/template/persistent/customer/form) to show the custom field named Website but I don't know how to get it working with all functions of the site.

My Magento version is

Please advice.

1 Answer 1


To use an attribute in the frontend you have to do two things.

  1. add the attribute to the EAV
  2. tell magento that the attribute should be used and is allowed to be saved by the customer. There are lots of attributes you don't want to be saved by the customer, for example created_at, updated_at or any account balance should not be editable by the customer.

    All the attributes are saved in the different forms via

    $customerForm = Mage::getModel('customer/form');

    Have a look on the form codes. They are important to change the attributes. there are a few, like customer_account_edit, customer_account_create. Just check the code if the forms doesn't save your attribute, what is needed and how the form is named.

Add the attribute

/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;

$vCustomerEntityType = $installer->getEntityTypeId('customer');
$vCustAttributeSetId = $installer->getDefaultAttributeSetId($vCustomerEntityType);
$vCustAttributeGroupId = $installer->getDefaultAttributeGroupId($vCustomerEntityType, $vCustAttributeSetId);


$attributes = array(
    'website' => 'Website',

foreach ($attributes as $name => $attribute) {
             'label'        => $attribute,
             'input'        => 'text',
             'type'         => 'varchar',
             'required'     => 0,
             'user_defined' => 1,

    $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, $name, 0);

Make attribute usable in forms

    $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', $name);
        array('customer_account_edit', 'customer_account_create', 'adminhtml_customer')


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.