Today i am going to show how to make an observers in Magento.
In this module we are going to make _load_after event to suffix something with product name in front-end area.In same way you can make any observer.
So Lets start.
2. Create Activation/deactivation File.<?xml version="1.0"?>2. Create configuration File.true local
<?xml version="1.0"?>3. Create Activation/deactivation FileSmartwin_Objer_Model Smartwin_Objer/Observer CatalogProductLoadAfter
<?php /* app/code/local/Smartwin/Objer/etc/Model/Observer.php */ class Smartwin_Objer_Model_Observer { public function CatalogProductLoadAfter(Varien_Event_Observer $observer) { /* Customize code here */ $product = $observer->getProduct(); $name = $product->setName($product->getName().' This is Cool!!!'); } } ?>
No comments:
Post a Comment