I want to do some processing on the products list (the products shown when browsing categories etc) before they are rendered.
I tried using the catalog_product_collection_load_after event, but its called on any products collection used, which include things like recently viewed items, related items, etc. and I only want to react on the time its called for the actual main products list.
I tried to filter the events by checking things like block type/name, controller name, page category etc, but they all proved to be insufficient to distinguish between the event on the main product list and other spam.
so my question:
- how can I edit the products list before they are shown via events (eg without editing Magento core code / temlates)?
- if your answer is "observe the catalog_product_collection_load_after event": how do I know which of the many product collections loaded is the main products grid?