The first step is to create a new module and create a new file in the app/etc/modules/directory shuishui_customer.xml
<config> <modules> <Shuishui_Customer> <active>true</active > <codePool>community</codePool> </Shuishui_Customer> </modules></ Config>
The second step, the new config configuration file for this module, is located in app/code/community/shuishui/customer/etc/config.xml
<?xml version="1.0"?><config> <modules> <Shuishui_Customer> <version>0.1.0</version> </Shuishui_Customer> </modules> <Global> <fieldsets> <customer_account> <mobile><create>1</create><update>1</update></mobile> </customer_account> </fieldsets> <models> < ; Shuishui_customer> <class>shuishui_customer_model</class> </Shuishui_Customer> </models> class>shuishui_customer_helper</class> </Shuishui_Customer> class>shuishui_customer_model_entity_setup</class> </setup> </customerattribute_setup> </resources> </Global> </config>
Step three, create a new Model class, inherit from the Mage_customer_model_entity_setup class, add a new field to the class, and position it in app/code/Community/shuishui/ customer/model/entity/setup.php
class Fanxiang_customer_model_entity_setup extends Mage_customer_model_entity_setup
'Created_at'=Array ('type'='Static', 'label'='Created at', 'Visible'=false, 'Required'=false, 'input'='Date', ), 'Mobile'=Array ('type'='Static', 'label'='Mobile', 'Visible'=true, 'Required'=false, 'Sort_order'= the, ), ), ), 'customer_address'=Array ('Entity_model'='customer/customer_address', 'Table'='customer/address_entity', 'additional_attribute_table'='Customer/eav_attribute', 'entity_attribute_collection'='customer/address_attribute_collection',
Fourth step, add a Database installation script file, location in app/code/community/shuishui/customer/sql/customerattribute_setup/ mysql4-install-0.1.0.php
$installer = $ This; $installer-Startsetup (); $installer->addattribute ('Customer','Mobile', Array ('label'='Mobile', 'Visible'=1, 'Required'=0, 'position'=1, 'Sort_order'= the, )); $installer-Endsetup (); $customerattribute= Mage::getmodel ('Customer/attribute')->loadbycode ('Customer','Mobile'); $forms= Array ('Customer_account_edit','customer_account_create','Adminhtml_customer','Checkout_register'); $customerattribute->setdata ('used_in_forms', $forms); $customerattribute->save ();
Fifth step, add a new form item in the template file of the foreground registration page, in template\customer\form\register.phtml
<li> <label for="Mobile" class="Required"><em>*</em><?php echo $ This->__ ('Mobile')?></label> <divclass="Input-box"> <input type="text"Name="Mobile"Id="Mobile"Value=""title="<?php Echo $this->__ (' mobile ')?>" class="Input-text required-entry"/> </div> </li>
Foreground display effect
Background Member Management page effect
ps:1.4 version is also available
See Original: http://mydons.com/how-to-add-custom-fields-to-customer-registration-and-account-page-in-magento-1-5/
New Member Registration field for Magento1.5 (GO)