0

My magento version 1.9 I created one custom field in customer registration form using below tutorial. http://phpmagento.blogspot.in/2012/02/custom-field-in-customer-registration.html

field is showing in database but while registration not saving the value. after registration.If we are editing the value it will save smoothly.

Thanks in advance.

0

I think the tutorial is missing the used_in_forms information.

While creating the customer attribute you have to specify where the attribute will be shown.

After adding your attribute with:

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('customer', 'my_attribute', array(
    ...
));

You have to tell Magento where to use it:

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

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.