create new module
add in magento
after that go to app/code/local/package/module/etc/config.xml
find "<frontend>" tag and put the code as given
<events>
<event>
<observers>
<Package_Module_Model_Observer>
<type>singleton</type>
<class>Package_Module_Model_Observer</class>
<method>Mytestmethod</method>
</Package_Module_Model_Observer>
</observers>
</event>
</events>
then go to app/code/local/package/module/model
create a file for event like observer.php
and put the code give for event
some thing like this
<?php
class Package_Module_Model_Observer_Observer {
public function Mytestmethod($observer) {
/*write your here code*/
//$observer->getEvent();
//$event->getProduct();
}
?>
add in magento
after that go to app/code/local/package/module/etc/config.xml
find "<frontend>" tag and put the code as given
<events>
<event>
<observers>
<Package_Module_Model_Observer>
<type>singleton</type>
<class>Package_Module_Model_Observer</class>
<method>Mytestmethod</method>
</Package_Module_Model_Observer>
</observers>
</event>
</events>
then go to app/code/local/package/module/model
create a file for event like observer.php
and put the code give for event
some thing like this
<?php
class Package_Module_Model_Observer_Observer {
public function Mytestmethod($observer) {
/*write your here code*/
//$observer->getEvent();
//$event->getProduct();
}
?>