I want to know which event is triggered when a category page is loaded from the megamenu? I want to load a custom collection of data based on a particular category.

  • what do you mean by "a category page is loaded from the megamenu?"
    – Marius
    May 27, 2022 at 15:35
  • @Marius It is when we click on a category link on the mega menu and that category page loads.
    – mechanic
    May 27, 2022 at 15:39
  • try to use catalog_controller_category_init_after but this is triggered for any category view. it does not matter if you click on it from the menu or from somewhere else
    – Marius
    May 27, 2022 at 15:48
  • Are you looking for custom collection for specific category?
    – S.P
    May 28, 2022 at 7:12
  • Thanks @Marius your solution worked.
    – mechanic
    Jun 1, 2022 at 14:43

2 Answers 2


In module-catalog you will find all the events related to the category, in etc/events.xml file you will find all the events. i guess this is your event.

<event name="magento_catalog_api_data_categoryinterface_load_after">
        <observer name="legacy_category_load_after" instance="Magento\Framework\EntityManager\Observer\AfterEntityLoad" />

You can update category's product collection by override Product Block.

Override your list block and apply condition in initializeProductCollection


Reference : Magento 2 Override ListProduct.php Block File

Also Magento provide event for product collection catalog_product_collection_load_after

check _afterLoad function in https://github.com/pepe1518/magento2/blob/master/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.