I want to create observer ,when a product is clicked ,can you tell me which is the event and how can I see in my observer code which product was clicked and to get information about it ?
This is my config.xml :
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Solvingmagento_OrderExport>
<version>0.1.0</version>
</Solvingmagento_OrderExport>
</modules>
<global>
<events>
<catalog_controller_product_view>
<observers>
<custom_catalog_controller_product_view>
<class>solvingmagento_orderexport/observer</class>
<method>observerProductClicked</method>
</custom_catalog_controller_product_view>
</observers>
</catalog_controller_product_view>
</events>
<helpers>
<orderexport>
<class>Solvingmagento_OrderExport_Helper</class>
</orderexport>
</helpers>
</global>
</config>
and my Observer.php :
class SolvingMagento_OrderExport_Model_Observer{
public function observerProductClicked(Varien_Event_Observer $observer)
{
$product = $observer->getProduct();
// Do what you want with the product
echo $product;
var_dump($_SERVER);
die('chekc');
}
}