I am using magento 1.9.1.0 in that i want to trap the event observer for product detail page .So for that we had created a custom observer and it is working properly for target_path url present in core_url_rewrite like (1.e catalog/product/view/id/1241641/category/352/store/2) but when i am using request path for the same (i.e /women/accessories/handbags/bag.html) then we are getting "The page you requested was not found".
My custom Module details are given below
Observer.php
class Gamer_CustomProduct_Model_Observer {
public function getProductView(Varien_Event_Observer $observer) {
echo "In getProductView";
exit;
}
}
Config.xml
<config>
<modules>
<Gamer_CustomProduct>
<version>0.1.0</version>
</Gamer_CustomProduct>
</modules>
<global>
<models>
<customproduct>
<class>Gamer_CustomProduct_Model</class>
</customproduct>
</models>
<events>
<catalog_controller_product_init_before>
<observers>
<catalog_controller_product_init_before_handler>
<type>model</type>
<class>customproduct/observer</class> <!-- observers class alias -->
<method>getProductView</method>
</catalog_controller_product_init_before_handler>
</observers>
</catalog_controller_product_init_before>
</events>
</global>
</config>
catalog_controller_product_init_before
.