Magento 2 events list

I put together a list of Magento 2 events using

find . -type f -exec grep -n -H -A 2 -T "eventManager->dispatch(" {} \;

The list is divided in 2 parts, one for static events and one for dynamics.

From here, static events are all those events defined with full event name like:

$this->_eventManager->dispatch('some_event');

Dynamic events are all those events defined with dynamically, at runtime, fetched event name like:

$this->_eventManager->dispatch($this->_eventPrefix . '_load_before', $params);

The list is in a spreadsheet for a better reading. I left 2 lines after the match for a better understanding of the event context.

The same list can be found searching in the official Magento 2 repo for _eventManager->dispatch


Obviously, not a good practice, but i am providing one link which has complied the important events in Magento2

http://cyrillschumacher.com/magento2-list-of-all-dispatched-events/

Ofcourse the events list is incomplete, as if you have worked with Magento 1.x, the events dispatch logic is retained

  1. lib/internal/Magento/Framework/Model/AbstractModel.php Load before and after events of a model

    $this->_eventManager->dispatch($this->_eventPrefix . '_load_before', $params);
    $this->_eventManager->dispatch($this->_eventPrefix . '_load_after', $params);
    

    Save before and after events of a model object

    $this->_eventManager->dispatch($this->_eventPrefix . '_save_before', $this->_getEventData());
    $this->_eventManager->dispatch($this->_eventPrefix . '_save_after', $this->_getEventData());
    

    Deleting a object

    $this->_eventManager->dispatch($this->_eventPrefix . '_delete_before', $this->_getEventData());
    $this->_eventManager->dispatch($this->_eventPrefix . '_delete_after', $this->_getEventData());
    

    Clearing an object

    $this->_eventManager->dispatch($this->_eventPrefix . '_clear', $this->_getEventData());
    
  2. Controller dispatch

    lib/internal/Magento/Framework/App/Action/Action.php

    $this->_eventManager->dispatch(
        'controller_action_predispatch_' . $request->getFullActionName(),
        $eventParameters
    );
    
    eg // controller_action_predispatch_checkout_cart_index
    
    
    $this->_eventManager->dispatch(
        'controller_action_postdispatch_' . $request->getFullActionName(),
        $eventParameters
    );
    eg // controller_action_postdispatch_checkout_cart_index
    
  3. Frontend layout render events

    $this->_eventManager->dispatch(
        'controller_action_layout_render_before_' . $this->_request->getFullActionName()
    );
    
  4. Collections of Models

    lib/internal/Magento/Framework/Model/ResourceModel/Db/Collection/AbstractCollection.php

    $this->_eventManager->dispatch($this->_eventPrefix . '_load_before', [$this->_eventObject => $this]);
    
    $this->_eventManager->dispatch($this->_eventPrefix . '_load_after', [$this->_eventObject => $this]);
    

There are many such events, and it is a combination of explicitly and implicitly generated events in Magento2