I am trying to get custom attribute value of customer in observer, but no results. Can anyone help me:
<frontend>
<events>
<customer_customer_authenticated>
<observers>
<ssd_customeractivation>
<type>singleton</type>
<class>SSD_CustomerActivation_Model_Observer</class>
<method>customerCustomerAuthenticated</method>
</ssd_customeractivation>
</observers>
</customer_customer_authenticated>
</events>
</frontend>
Observer.php
class SSD_CustomerActivation_Model_Observer
{
public function customerCustomerAuthenticated($observer)
{
/**
* @var $customer Mage_Customer_Model_Customer
*/
$customer = $observer->getEvent()->getModel();
Mage::log($customer->getData('customer_active'));
}
}
Installer:
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$attributeCode = 'customer_active';
$setup->addAttribute('customer', $attributeCode, array(
'label' => 'Is Active',
'type' => 'int',
'input' => 'boolean',
'visible' => true,
'required' => false,
'position' => 530,
));
$eavConfig = Mage::getSingleton('eav/config');
$attribute = $eavConfig->getAttribute('customer', 'is_active');
$usedInForms = array(
'adminhtml_customer',
);
$attribute->setData('used_in_forms', $usedInForms);
$attribute->save();
$installer->endSetup();