Display custom customer field in admin at magento 1.6

To make the new customer attributes saveable in frontend (register and edit) and display admin section execute this code.

eavConfig = Mage::getSingleton('eav/config');
$attribute = $eavConfig->getAttribute('customer', 'your_new_attribute');
$attribute->setData('used_in_forms',   array('customer_account_edit',
                                             'customer_account_create',
                                             'adminhtml_customer'));
$attribute->save();

To make the new customer address attributes saveable in frontend (register and edit) and display admin section execute this

eavConfig = Mage::getSingleton('eav/config');
$attribute = $eavConfig->getAttribute('customer_address', 'your_new_attribute');
$attribute->setData('used_in_forms',   array('customer_register_address',
                                             'ccustomer_address_edit',
                                             'adminhtml_customer_addres'));
$attribute->save();

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.