you can run the following script from the root directory of magento, this attribute to add the attribute to the client and available to create the client and edit the client information, for example, I took 'mobile' here so that you can get this attribute using the getMobile() method in editing the client and creating a client page .... this script also automatically adds and displays in the admin panel, try these.
define('MAGENTO', realpath(dirname(__FILE__))); require_once MAGENTO . '/app/Mage.php'; Mage::app(); $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); $vCustomerEntityType = $installer->getEntityTypeId('customer'); $vCustAttributeSetId = $installer->getDefaultAttributeSetId($vCustomerEntityType); $vCustAttributeGroupId = $installer->getDefaultAttributeGroupId($vCustomerEntityType, $vCustAttributeSetId); $installer->addAttribute('customer', 'mobile', array( 'label' => 'Customer Mobile', 'input' => 'text', 'type' => 'varchar', 'forms' => array('customer_account_edit','customer_account_create','adminhtml_customer','checkout_register'), 'required' => 0, 'user_defined' => 1, )); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'mobile', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'mobile'); $oAttribute->setData('used_in_forms', array('customer_account_edit','customer_account_create','adminhtml_customer','checkout_register')); $oAttribute->save(); $installer->endSetup();
Show attribute at the end of the font.
add the following code to the edit.phtml file located at application / design / interface / base / default / template / client / form / edit.phtml
<li> <label class="required"><?php echo $this->__('Mobile') ?><em>*</em></label> </li> <li> <input type="text" value="<?php echo $this->getCustomer()->getMobile(); ?>" title="<?php echo $this->__('Mobile') ?>" name="mobile" class="input-text validate-digits-range digits-range-1000000000-9999999999 required-entry"> </li>
source share