I'm trying to use observers
My goal is to do something after successful login
I wrote this but I think I don't understand something...
What's wrong?
app/etc/modules/Drg_Customeraccess.xml
<?xml version="1.0"?>
<config>
<modules>
<Drg_Customeraccess>
<active>true</active>
<codePool>local</codePool>
</Drg_Customeraccess>
</modules>
</config>
app/code/local/Drg/Customeraccess/etc/config.xml
<?xml version="1.0"?>
<customer_login>
<observers>
<Drg_Customeraccess>
<type>model</type>
<class>Drg_Customeraccess/observer</class>
<method>customerLogin</method>
</Drg_Customeraccess>
</observers>
</customer_login>
app/code/local/Drg/Customeraccess/Model/observer.php
<?php
class Drg_Customeraccess_Model_Observer
{
public function customerLogin($observer)
{
$customer = $observer->getCustomer();
if ($customer){
echo "nameOBS-".$customer->getFirstname();
}
}
}
?>
Thank you