title: Magento - Add attribute to customer entity
body: <p>For two days I have been trying to <strong>add new customer attribute</strong> to the magento database. But it isn't working. I added a simple <code>nickname</code> input field to the <code>register.phtml</code> and <code>edit.phtml</code> following this tutorial:</p>
  <p><a href="http://www.magentocommerce.com/wiki/5_-_modules_and_development/customers_and_accounts/registration_fields" rel="noreferrer">http://www.magentocommerce.com/wiki/5_-_modules_and_development/customers_and_accounts/registration_fields</a></p>
  <p>Here is the inherent forum post:</p>
  <p><a href="http://www.magentocommerce.com/boards/viewthread/9620/" rel="noreferrer">http://www.magentocommerce.com/boards/viewthread/9620/</a></p>
  <p>The attribute is added to the database table <code>eav_attribute</code>, but the value doesn't appear in the <code>customer_entity_varchar</code>.</p>
  <hr />
  <h2>Here is what I have:</h2>
  <p>All files are located under <code>app/code/local/Company/</code></p>
  <hr />
  <p><strong>app/code/local/Company/Customer/etc/config.xml</strong></p>
  <p>(watch out for: <code>&lt;!-- nickname --&gt;</code>)</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Company_Customer&gt;
              &lt;version&gt;0.1.0&lt;/version&gt;
          &lt;/Company_Customer&gt;
      &lt;/modules&gt;
      &lt;admin&gt;
          &lt;fieldsets&gt;
              &lt;customer_dataflow&gt;
                  &lt;store_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;/store_id&gt;
                  &lt;store&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/store&gt;
                  &lt;entity_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/entity_id&gt;
                  &lt;attribute_set_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/attribute_set_id&gt;
                  &lt;attribute_set&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/attribute_set&gt;
                  &lt;entity_type_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;/entity_type_id&gt;
                  &lt;increment_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/increment_id&gt;
                  &lt;parent_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;/parent_id&gt;
                  &lt;created_at&gt;&lt;system&gt;1&lt;/system&gt;&lt;/created_at&gt;
                  &lt;updated_at&gt;&lt;system&gt;1&lt;/system&gt;&lt;/updated_at&gt;
                  &lt;group_id&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/group_id&gt;
                  &lt;type_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/type_id&gt;
                  &lt;type&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/type&gt;
                  &lt;created_in&gt;&lt;system&gt;1&lt;/system&gt;&lt;ignore&gt;1&lt;/ignore&gt;&lt;/created_in&gt;
                  &lt;website_id&gt;&lt;system&gt;1&lt;/system&gt;&lt;/website_id&gt;
                  &lt;default_billing&gt;&lt;system&gt;1&lt;/system&gt;&lt;/default_billing&gt;
                  &lt;default_shipping&gt;&lt;system&gt;1&lt;/system&gt;&lt;/default_shipping&gt;
   
                  &lt;prefix&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;mapped&gt;1&lt;/mapped&gt;&lt;/prefix&gt;
                  &lt;firstname&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;required&gt;1&lt;/required&gt;&lt;mapped&gt;1&lt;/mapped&gt;&lt;/firstname&gt;
                  &lt;middlename&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;mapped&gt;1&lt;/mapped&gt;&lt;/middlename&gt;
                  &lt;lastname&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;required&gt;1&lt;/required&gt;&lt;mapped&gt;1&lt;/mapped&gt;&lt;/lastname&gt;
                  &lt;suffix&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;mapped&gt;1&lt;/mapped&gt;&lt;/suffix&gt;
                  &lt;street_full&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/street_full&gt;
                  &lt;street1&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street1&gt;
                  &lt;street2&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street2&gt;
                  &lt;street3&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street3&gt;
                  &lt;street4&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street4&gt;
                  &lt;street5&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street5&gt;
                  &lt;street6&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street6&gt;
                  &lt;street7&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street7&gt;
                  &lt;street8&gt;&lt;street&gt;1&lt;/street&gt;&lt;/street8&gt;
                  &lt;city&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/city&gt;
                  &lt;region&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/region&gt;
                  &lt;country&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;billing_required&gt;1&lt;/billing_required&gt;&lt;shipping_required&gt;1&lt;/shipping_required&gt;&lt;/country&gt;
                  &lt;postcode&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;billing_required&gt;1&lt;/billing_required&gt;&lt;shipping_required&gt;1&lt;/shipping_required&gt;&lt;/postcode&gt;
                  &lt;telephone&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/telephone&gt;
                  &lt;company&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/company&gt;
                  &lt;fax&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/fax&gt;
                  &lt;mobile&gt;&lt;billing&gt;1&lt;/billing&gt;&lt;shipping&gt;1&lt;/shipping&gt;&lt;/mobile&gt;
                  &lt;!-- nickname --&gt;
                  &lt;nickname&gt;&lt;system&gt;1&lt;/system&gt;&lt;/nickname&gt;
              &lt;/customer_dataflow&gt;
          &lt;/fieldsets&gt;
      &lt;/admin&gt;
      &lt;global&gt;
          &lt;fieldsets&gt;
              &lt;customer_account&gt;
                  &lt;prefix&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/prefix&gt;
                  &lt;firstname&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/firstname&gt;
                  &lt;middlename&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/middlename&gt;
                  &lt;lastname&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/lastname&gt;
                  &lt;suffix&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;name&gt;1&lt;/name&gt;&lt;/suffix&gt;
                  &lt;email&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/email&gt;
                  &lt;password&gt;&lt;create&gt;1&lt;/create&gt;&lt;/password&gt;
                  &lt;confirmation&gt;&lt;create&gt;1&lt;/create&gt;&lt;/confirmation&gt;
                  &lt;dob&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/dob&gt;
                  &lt;taxvat&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/taxvat&gt;
                                   &lt;!-- nickname --&gt;
                  &lt;nickname&gt;&lt;create&gt;1&lt;/create&gt;&lt;update&gt;1&lt;/update&gt;&lt;/nickname&gt;
              &lt;/customer_account&gt;
          &lt;/fieldsets&gt;
   
          &lt;customer&gt;
              &lt;address&gt;
                  &lt;formats&gt;
                      &lt;text translate=&quot;title&quot; module=&quot;customer&quot;&gt;
                          &lt;title&gt;Text&lt;/title&gt;
                          &lt;defaultFormat&gt;&lt;![CDATA[
  {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
  {{depend company}}{{var company}}{{/depend}}
  {{var street1}}
  {{depend street2}}{{var street2}}{{/depend}}
  {{depend street3}}{{var street3}}{{/depend}}
  {{depend street4}}{{var street4}}{{/depend}}
  {{depend city}}{{var city}},  {{/depend}}{{depend region}}{{var region}}, {{/depend}}{{var postcode}}
  {{var country}}
  T: {{var telephone}}
  {{depend fax}}F: {{var fax}}{{/depend}}
  {{depend mobile}}M: {{var mobile}}{{/depend}}
                          ]]&gt;&lt;/defaultFormat&gt;
                      &lt;/text&gt;
                      &lt;oneline translate=&quot;title&quot; module=&quot;customer&quot;&gt;
                          &lt;title&gt;Text One Line&lt;/title&gt;
                          &lt;htmlEscape&gt;true&lt;/htmlEscape&gt;
                          &lt;defaultFormat&gt;
  &lt;![CDATA[{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, {{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}}]]&gt;
                          &lt;/defaultFormat&gt;
                      &lt;/oneline&gt;
                      &lt;html translate=&quot;title&quot; module=&quot;customer&quot;&gt;
                          &lt;title&gt;HTML&lt;/title&gt;
                          &lt;htmlEscape&gt;true&lt;/htmlEscape&gt;
                          &lt;defaultFormat&gt;&lt;![CDATA[
  {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}&lt;br/&gt;
  {{depend company}}{{var company}}&lt;br /&gt;{{/depend}}
  {{var street1}}&lt;br /&gt;
  {{depend street2}}{{var street2}}&lt;br /&gt;{{/depend}}
  {{depend street3}}{{var street3}}&lt;br /&gt;{{/depend}}
  {{depend street4}}{{var street4}}&lt;br /&gt;{{/depend}}
  {{depend city}}{{var city}},  {{/depend}}{{depend region}}{{var region}}, {{/depend}}{{var postcode}}&lt;br/&gt;
  {{var country}}&lt;br/&gt;
  {{depend telephone}}T: {{var telephone}}{{/depend}}
  {{depend fax}}&lt;br/&gt;F: {{var fax}}{{/depend}}
  {{depend mobile}}&lt;br/&gt;M: {{var mobile}}{{/depend}}
              ]]&gt;&lt;/defaultFormat&gt;
                      &lt;/html&gt;
                      &lt;pdf translate=&quot;title&quot; module=&quot;customer&quot;&gt;
                          &lt;title&gt;PDF&lt;/title&gt;
                          &lt;defaultFormat&gt;&lt;![CDATA[
  {{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}|
  {{depend company}}{{var company}}|{{/depend}}
  {{var street1}}|
  {{depend street2}}{{var street2}}|{{/depend}}
  {{depend street3}}{{var street3}}|{{/depend}}
  {{depend street4}}{{var street4}}|{{/depend}}
  {{depend city}}{{var city}},  {{/depend}}{{depend region}}{{var region}}, {{/depend}}{{var postcode}}|
  {{var country}}|
  {{depend telephone}}T: {{var telephone}}{{/depend}}|
  {{depend fax}}&lt;br/&gt;F: {{var fax}}{{/depend}}|
  {{depend mobile}}&lt;br/&gt;M: {{var mobile}}{{/depend}}|
              ]]&gt;&lt;/defaultFormat&gt;
                      &lt;/pdf&gt;
                      &lt;js_template template=&quot;title&quot; module=&quot;customer&quot;&gt;
                          &lt;title&gt;Javascript Template&lt;/title&gt;
                          &lt;defaultFormat&gt;&lt;![CDATA[#{prefix} #{firstname} #{middlename} #{lastname} #{suffix}&lt;br/&gt;#{company}&lt;br/&gt;#{street0}&lt;br/&gt;#{street1}&lt;br/&gt;#{street2}&lt;br/&gt;#{street3}&lt;br/&gt;#{city}, #{region}, #{postcode}&lt;br/&gt;#{country_id}&lt;br/&gt;T: #{telephone}&lt;br/&gt;F: #{fax}&lt;br/&gt;M: #{mobile}]]&gt;&lt;/defaultFormat&gt;
                      &lt;/js_template&gt;
                  &lt;/formats&gt;
              &lt;/address&gt;
          &lt;/customer&gt;
          &lt;models&gt;
              &lt;customer_entity&gt;
                  &lt;rewrite&gt;
                      &lt;setup&gt;Company_Customer_Model_Entity_Setup&lt;/setup&gt;
                  &lt;/rewrite&gt;
              &lt;/customer_entity&gt;
          &lt;/models&gt;
          &lt;resources&gt;
              &lt;customer_setup&gt;
                  &lt;rewrite&gt;
                      &lt;setup&gt;Company_Customer_Model_Entity_Setup&lt;/setup&gt;
                  &lt;/rewrite&gt;
              &lt;/customer_setup&gt;
          &lt;/resources&gt;
      &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  <p><strong>app/code/local/Company/Customer/Model/Entity/Setup.php</strong></p>
  <p>(watch out again for: <code>/* nickname */</code>)</p>
  <pre class="lang-php prettyprint-override"><code>class Company_Customer_Model_Entity_Setup extends Mage_Customer_Model_Entity_Setup{
              
      public function getDefaultEntities()
          {
              return array(
                  'customer' =&gt; array(
                      'entity_model'          =&gt;'customer/customer',
                      'table'                 =&gt; 'customer/entity',
                      'increment_model'       =&gt; 'eav/entity_increment_numeric',
                      'increment_per_store'   =&gt; false,
                      'additional_attribute_table' =&gt; 'customer/eav_attribute',
                      'entity_attribute_collection' =&gt; 'customer/attribute_collection',
                      'attributes' =&gt; array(
      //                    'entity_id'         =&gt; array('type'=&gt;'static'),
      //                    'entity_type_id'    =&gt; array('type'=&gt;'static'),
      //                    'attribute_set_id'  =&gt; array('type'=&gt;'static'),
      //                    'increment_id'      =&gt; array('type'=&gt;'static'),
      //                    'created_at'        =&gt; array('type'=&gt;'static'),
      //                    'updated_at'        =&gt; array('type'=&gt;'static'),
      //                    'is_active'         =&gt; array('type'=&gt;'static'),
      
                          'website_id' =&gt; array(
                              'type'          =&gt; 'static',
                              'label'         =&gt; 'Associate to Website',
                              'input'         =&gt; 'select',
                              'source'        =&gt; 'customer/customer_attribute_source_website',
                              'backend'       =&gt; 'customer/customer_attribute_backend_website',
                              'sort_order'    =&gt; 10,
                          ),
                          'store_id' =&gt; array(
                              'type'          =&gt; 'static',
                              'label'         =&gt; 'Create In',
                              'input'         =&gt; 'select',
                              'source'        =&gt; 'customer/customer_attribute_source_store',
                              'backend'       =&gt; 'customer/customer_attribute_backend_store',
                              'visible'       =&gt; false,
                              'sort_order'    =&gt; 20,
                          ),
                          'created_in' =&gt; array(
                              'type'          =&gt; 'varchar',
                              'label'         =&gt; 'Created From',
                              'sort_order'    =&gt; 30,
                          ),
                          'prefix' =&gt; array(
                              'label'         =&gt; 'Prefix',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 37,
                          ),
                          'firstname' =&gt; array(
                              'label'         =&gt; 'First Name',
                              'sort_order'    =&gt; 40,
                          ),
                          'middlename' =&gt; array(
                              'label'         =&gt; 'Middle Name/Initial',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 43,
                          ),
                          'lastname' =&gt; array(
                              'label'         =&gt; 'Last Name',
                              'sort_order'    =&gt; 50,
                          ),
                          'suffix' =&gt; array(
                              'label'         =&gt; 'Suffix',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 53,
                          ),
                          'email' =&gt; array(
                              'type'          =&gt; 'static',
                              'label'         =&gt; 'Email',
                              'class'         =&gt; 'validate-email',
                              'sort_order'    =&gt; 60,
                          ), /* nickname */
                          'nickname' =&gt; array(
                              'label'         =&gt; 'nickname',
                              'unique'        =&gt; true,
                              'sort_order'    =&gt; 65,
                              'required'      =&gt; true,
                          ),
                          'group_id' =&gt; array(
                              'type'          =&gt; 'static',
                              'input'         =&gt; 'select',
                              'label'         =&gt; 'Group',
                              'source'        =&gt; 'customer/customer_attribute_source_group',
                              'sort_order'    =&gt; 70,
                          ),
                          'dob' =&gt; array(
                              'type'          =&gt; 'datetime',
                              'input'         =&gt; 'date',
                              'backend'       =&gt; 'eav/entity_attribute_backend_datetime',
                              'required'      =&gt; false,
                              'label'         =&gt; 'Date Of Birth',
                              'sort_order'    =&gt; 80,
                          ),
                          'password_hash' =&gt; array(
                              'input'         =&gt; 'hidden',
                              'backend'       =&gt; 'customer/customer_attribute_backend_password',
                              'required'      =&gt; false,
                          ),
                          'default_billing' =&gt; array(
                              'type'          =&gt; 'int',
                              'visible'       =&gt; false,
                              'required'      =&gt; false,
                              'backend'       =&gt; 'customer/customer_attribute_backend_billing',
                          ),
                          'default_shipping' =&gt; array(
                              'type'          =&gt; 'int',
                              'visible'       =&gt; false,
                              'required'      =&gt; false,
                              'backend'       =&gt; 'customer/customer_attribute_backend_shipping',
                          ),
                          'taxvat' =&gt; array(
                              'label'         =&gt; 'Tax/VAT Number',
                              'visible'       =&gt; true,
                              'required'      =&gt; false,
                          ),
                          'confirmation' =&gt; array(
                              'label'         =&gt; 'Is Confirmed',
                              'visible'       =&gt; false,
                              'required'      =&gt; false,
                          ),
                          'created_at' =&gt; array(
                              'type'          =&gt; 'static',
                              'label'         =&gt; 'Created At',
                              'visible'       =&gt; false,
                              'required'      =&gt; false,
                              'input'         =&gt; 'date',
                          ),
                      ),
                  ),
      
                  'customer_address'=&gt;array(
                      'entity_model'  =&gt;'customer/customer_address',
                      'table' =&gt; 'customer/address_entity',
                      'additional_attribute_table' =&gt; 'customer/eav_attribute',
                      'entity_attribute_collection' =&gt; 'customer/address_attribute_collection',
                      'attributes' =&gt; array(
      //                    'entity_id'         =&gt; array('type'=&gt;'static'),
      //                    'entity_type_id'    =&gt; array('type'=&gt;'static'),
      //                    'attribute_set_id'  =&gt; array('type'=&gt;'static'),
      //                    'increment_id'      =&gt; array('type'=&gt;'static'),
      //                    'parent_id'         =&gt; array('type'=&gt;'static'),
      //                    'created_at'        =&gt; array('type'=&gt;'static'),
      //                    'updated_at'        =&gt; array('type'=&gt;'static'),
      //                    'is_active'         =&gt; array('type'=&gt;'static'),
      
                          'prefix' =&gt; array(
                              'label'         =&gt; 'Prefix',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 7,
                          ),
                          'firstname' =&gt; array(
                              'label'         =&gt; 'First Name',
                              'sort_order'    =&gt; 10,
                          ),
                          'middlename' =&gt; array(
                              'label'         =&gt; 'Middle Name/Initial',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 13,
                          ),
                          'lastname' =&gt; array(
                              'label'         =&gt; 'Last Name',
                              'sort_order'    =&gt; 20,
                          ),
                          'suffix' =&gt; array(
                              'label'         =&gt; 'Suffix',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 23,
                          ),
                          'company' =&gt; array(
                              'label'         =&gt; 'Company',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 30,
                          ),
                          'street' =&gt; array(
                              'type'          =&gt; 'text',
                              'backend'       =&gt; 'customer_entity/address_attribute_backend_street',
                              'input'         =&gt; 'multiline',
                              'label'         =&gt; 'Street Address',
                              'sort_order'    =&gt; 40,
                          ),
                          'city' =&gt; array(
                              'label'         =&gt; 'City',
                              'sort_order'    =&gt; 50,
                          ),
                          'country_id' =&gt; array(
                              'type'          =&gt; 'varchar',
                              'input'         =&gt; 'select',
                              'label'         =&gt; 'Country',
                              'class'         =&gt; 'countries',
                              'source'        =&gt; 'customer_entity/address_attribute_source_country',
                              'sort_order'    =&gt; 60,
                          ),
                          'region' =&gt; array(
                              'backend'       =&gt; 'customer_entity/address_attribute_backend_region',
                              'label'         =&gt; 'State/Province',
                              'class'         =&gt; 'regions',
                              'sort_order'    =&gt; 70,
                          ),
                          'region_id' =&gt; array(
                              'type'          =&gt; 'int',
                              'input'         =&gt; 'hidden',
                              'source'        =&gt; 'customer_entity/address_attribute_source_region',
                              'required'      =&gt; 'false',
                              'sort_order'    =&gt; 80,
                              'label'         =&gt; 'State/Province'
                          ),
                          'postcode' =&gt; array(
                              'label'         =&gt; 'Zip/Postal Code',
                              'sort_order'    =&gt; 90,
                          ),
                          'telephone' =&gt; array(
                              'label'         =&gt; 'Telephone',
                              'sort_order'    =&gt; 100,
                          ),
                          'fax' =&gt; array(
                              'label'         =&gt; 'Fax',
                              'required'      =&gt; false,
                              'sort_order'    =&gt; 110,
                          ),
                      ),
                  ),
              );
          }   
  }
  </code></pre>
  <p><strong>app/design/frontend/default/company/template/customer/form/register.phtml</strong></p>
  <pre><code>&lt;label for=&quot;nickname&quot; class=&quot;required&quot; style=&quot;margin-left: -1px;&quot;&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $this-&gt;__('Nickname') ?&gt;&lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;nickname&quot; id=&quot;nickname&quot; value=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getFormData()-&gt;getnickname()) ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;__('Nickname') ?&gt;&quot; class=&quot;input-text required-entry&quot; /&gt;
  </code></pre>
  <p>i also run this piece of php code in the top of <strong>register.phtml</strong> to add the attribute to the <strong>eav_attribute</strong>
  this code was executed once:</p>
  <pre><code>&lt;?php
      $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
      $AttrCode = 'nickname';
      $settings = array (
          'position' =&gt; 1,
          'is_required' =&gt; 0
      );
      $setup-&gt;addAttribute('1', $AttrCode, $settings);
  ?&gt;
  </code></pre>
  <p><strong>app/design/frontend/default/company/template/customer/form/edit.phtml</strong></p>
  <pre><code>&lt;label for=&quot;nickname&quot; class=&quot;required&quot; style=&quot;margin-left: -1px;&quot;&gt;&lt;em&gt;*&lt;/em&gt;&lt;?php echo $this-&gt;__('Nickname') ?&gt;&lt;/label&gt;
  &lt;input type=&quot;text&quot; name=&quot;nickname&quot; id=&quot;nickname&quot; value=&quot;&lt;?php echo $this-&gt;htmlEscape($this-&gt;getCustomer()-&gt;getnickname()) ?&gt;&quot; title=&quot;&lt;?php echo $this-&gt;__('Nickname') ?&gt;&quot; class=&quot;input-text required-entry&quot; /&gt;
  </code></pre>
  <p>I also manually cleared the <strong>/var/cache</strong> folder but without any effect.</p>
  <p>I have no idea what else I could do, so any help is very welcome.</p>
  <p><strong>EDIT:</strong></p>
  <p>Ok here is what i have tried on the magento root:</p>
  <pre><code>define('MAGENTO', realpath(dirname(__FILE__)));
  ini_set('memory_limit', '32M');
  set_time_limit (0);
  require_once MAGENTO . '/app/Mage.php';
  
  Mage::app();
  
  $installer = $this;
  $installer-&gt;startSetup();
  
  $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
  
  $entityTypeId     = $setup-&gt;getEntityTypeId('customer');
  $attributeSetId   = $setup-&gt;getDefaultAttributeSetId($entityTypeId);
  $attributeGroupId = $setup-&gt;getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
  
  $setup-&gt;addAttribute('customer', 'nickname', array(
      'input'         =&gt; 'text',
      'type'          =&gt; 'text',
      'label'         =&gt; 'Nickname',
      'visible'       =&gt; 1,
      'required'      =&gt; 1,
      'user_defined'  =&gt; 1,
  ));
  
  $setup-&gt;addAttributeToGroup(
   $entityTypeId,
   $attributeSetId,
   $attributeGroupId,
   'nickname',
   '999'  //sort_order
  );
  
  
  $oAttribute = Mage::getSingleton('eav/config')-&gt;getAttribute('customer', 'nickname');
  $oAttribute-&gt;setData('used_in_forms', array('adminhtml_customer'));
  
  $oAttribute-&gt;save();
  $installer-&gt;endSetup();
  </code></pre>
  <p>This code will be executed fine and there is no error message or something but also no new attribute added to the <strong>eav_attribute</strong> table.</p>