I am working on a magento extension used for analytics purposes which requires functionality which responds to a variety of Magento events.
One of these events is
catalog_controller_product_view which I need to extra the product data and do something with (I have no problems with this bit).
The issue I have is after the first time viewing a product Magento no longer raises the
catalog_controller_product_view event for my Observer execute method is never called.
I have logged every Magento event as a debugging measure and the
catalog_controller_product_view is definitely not being raised on every product view only the first one per product. In addition I can't see any event to hook into, Ive tried injecting the Request Interface and getting the request response which may contain product data but no luck.
Any ideas how to solve this?
<event name='catalog_controller_product_view'> <observer name='Path/To/Observer/ViewProduct' instance='Path/To/Observer/ViewProduct' /> </event>
Existing Observer (
Path/To/Observer/ViewProduct) relevant lines:
$event = $observer->getEvent(); $product = $event->getData('product'); // do something with $product
To clarify what I'm after I need a way to accurate retrieve a product view regardless of caching, or a way to add the event to cache exceptions (if possible).