I'm using Magento 1.4.1.1. After logout success, customer is rooted to "logout.phtml" first and "home page" later.
Is there anyway I could make Magento run couple of "php" codes after "login" success ?
Please don't hesitate to provide code samples as I'm new in Magento.
/var/www/app/etc/modules/Lpf_ModuleCookie.xml
<?xml version="1.0"?>
<config>
<modules>
<Lpf_ModuleCookie>
<active>true</active>
<codePool>local</codePool>
</Lpf_ModuleCookie>
</modules>
</config>
/var/www/app/code/local/Lpf/ModuleCookie/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Lpf_ModuleCookie>
<version>0.1</version>
</Lpf_ModuleCookie>
</modules>
<events>
<customer_login>
<observers>
<customer_login>
<type>model</type>
<class>ModuleCookie/observer</class>
<method>customerLogin</method>
</customer_login>
</observers>
</customer_login>
</events>
</config>
/var/www/app/code/local/Lpf/Observer.php
<?php
class Lpf_ModuleCookie_Model_Observer
{
/**
* Run couple of 'php' codes after customer logs in
*
* @param Varien_Event_Observer $observer
*/
public function customerLogin($observer)
{
Mage::log(__METHOD__ . '() Hello!'); // Remove afterwards. Check your var/log/system.log to see if came to this point
$customer = $observer->getCustomer();
// "run couple of 'php' codes"
}
}
?>