cancel
Showing results for 
Search instead for 
Did you mean: 

create custom field in register form also show in all place in account edit and checkout and in admi

create custom field in register form also show in all place in account edit and checkout and in admi

Hello ,

I want to customize registratio form andalso in  account edit ,admin customer form  , any exapmle or hints.

thanks,

Gaurav sharma

1 REPLY 1

Re: create custom field in register form also show in all place in account edit and checkout and in

Hi @gauravsh8790,

 

You could use an install script with something like this:

 

$installer = $this;
$installer->startSetup();
$entity = $installer->getEntityTypeId('customer');

$installer->addAttribute($entity, 'your_new_attribute', array(
        'type' => 'text',
        'label' => 'Your New Attribute',
        'input' => 'text',
        'visible' => true,
        'required' => false,
        'adminhtml_only' => 0
));

$forms = array(
    'customer_address_edit',
    'customer_register_address',
    'customer_account_create',
    'customer_account_edit',
    'checkout_register',
    'adminhtml_customer',
    'adminhtml_checkout',
    'adminhtml_customer_address'
);
$attribute = Mage::getSingleton('eav/config')->getAttribute($entity, 'your_new_attribute');
$attribute->setData('used_in_forms', $forms);
$attribute->save();

$installer->endSetup();

Make a backup before execute the install script.