Events and Observers in Magento2

Events and Observers in Magento2

Introduction

In this article, we are going to learn :

  • What are the Events
  • How the events dispatches
  • What are the events Areas
  • What are the Observers
  • How to use of the Events and observers.
  • Examples of events and observers
  • How to know list of Events fired for specific action
  • List of all events present in the Magento2

Events and Observers are used to extend the Magento’s Core functionality. Magento 2 has event driven architecture.

What are the Events in Magento2

Basically, the event is an action that occurs in a response of the user interaction such as a user logged in, a user logged out, add to cart etc. And when an event occurs it passes data to observers and the observer runs the logic you have created. So using events and observers, you can run your code in response to a specific Magento event or even a custom event.

There are so many events already created in the Magento 2 system. Here is the list of all events fired in Magento2 ststem. The question comes, can we create our own event? The answer to this question in YES.

How the Events dispatches in Magento2

Events are dispatched by modules when certain actions are triggered. The events are dispatched using the Magento\Framework\Event\Manager class, which implements Magento\Framework\Event\ManagerInterface.  This class can be obtained through dependency injection by defining the dependency in your constructor.

The “Event” is called by a method called dispatch. To dispatch an event, we simply call the dispatch method of the event manager instance, providing it with the name of the event we are dispatching with an optional array of data we wish to pass on to the observers.

Example 

  • Event name: customer_login
  • File: vendor/magento/module-customer/Model/Session.php

	$this->_eventManager->dispatch('customer_login', ['customer' => $customer]);

 

In addition to its own events, Magento allows you to create your own events that can be dispatched in your code. When an event is dispatched, all the observers associated with this event will be called.

What are the Events Areas in Magento2

Generally, the location of the events.xml file will be under the <module-root>/etc directory. Observers that are associated with events here will watch for these events globally. The events.xml file can also be defined

  • Under etc/ folder is the configuration which can be used in both admin and frontend.
  • Under etc/frontend folder will be used for frontend area.
  • Under etc/adminhtml folder will be used for admin area.

Declare the observer in the appropriate area. The global area allows the observer to run in all areas (adminhtmlcrontabfrontendgraphqlwebapi_restwebapi_soap).

AREA FILE LOCATION
global <module-dir>/etc/events.xml
adminhtml <module-dir>/etc/adminhtml/events.xml
crontab <module-dir>/etc/crontab/events.xml
frontend <module-dir>/etc/frontend/events.xml
graphql <module-dir>/etc/graphql/events.xml
webapi_rest <module-dir>/etc/webapi_rest/events.xml
webapi_soap <module-dir>/etc/webapi_soap/events.xml

 

What are the Observers in Magento2

Observers are a certain type of Magento class that can influence general behavior, performance, or change business logic. Observers are executed whenever the event they are configured to watch is dispatched by the event manager.

Observers are registered via an events.xml file.

Points to remember for creating Observer:

  1. Make your observer efficient: You should try to keep your observer small and efficient by avoiding complex computations if you can. Because having complex computations in your observer can slow down application processes.
  2. Don’t include business logic: Your observer should not contain logic other than what is needed for it to run. Business logic should be encapsulated in other classes that your observer uses.
  • Creating an observer:

Observers are capable of modifying the behavior of a Magento application because they are dynamically injected into the execution flow.  Observers listening to the same event may be invoked in any order when that event is dispatched.

To create an observer, you must place your class file under your <module-root>/Observer directory. Your observer class should implement Magento\Framework\Event\ObserverInterface and define its execute function.

Under Magento, an Observer is a class that implements the Magento\Framework\Event\ObserverInterface interface, meaning that it takes a method that runs with an \Magento\Framework\Event\Observer argument. We will therefore create our class like this:

Below is an example of the basic observer class structure:

<?php
namespace Thecoachsmb\MyModule\Observer;

use Magento\Framework\Event\ObserverInterface;

class MyObserver implements ObserverInterface
{
  public function __construct()
  {
    // Observer initialization code...
    // You can use dependency injection to get any class this observer may need.
  }

  public function execute(\Magento\Framework\Event\Observer $observer)
  {
    // observer execution code...
  }
}

One of the more powerful feature of observers is that they are able to use parameters passed into the event when it was dispatched. Below is an example of an observer obtaining data passed in when the event was dispatched.

<?php
namespace Thecoachsmb\MyModule\Observer;

use Magento\Framework\Event\ObserverInterface;

class AnotherObserver implements ObserverInterface
{
  public function __construct()
  {
    // Observer initialization code...
    // You can use dependency injection to get any class this observer may need.
  }

  public function execute(\Magento\Framework\Event\Observer $observer)
  {
    $myEventData = $observer->getData('myEventData');
    // Additional observer execution code...
  }
}
  • Configure Observers:

Observers can be configured to watch certain events in the events.xml file.

The events.xml file element has the following properties:

  • name (required) – The name of the observer for the event definition.
  • instance (required) – The fully qualified class name of the observer.
  • disabled – Determines whether this observer is active or not. Default value is false.
  • shared – Determines the lifestyle of the class. Default is true.

The observer name must be unique, or an override will occur.

Below is an example of how to assign observers to watch certain events:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="my_module_event_before">
        <observer name="myObserverName" instance="MyCompany\MyModule\Observer\MyObserver" />
    </event>
    <event name="my_module_event_after">
        <observer name="myObserverName" instance="MyCompany\MyModule\Observer\AnotherObserver" />
    </event>
</config>

In the preceding example, we assign the observer MyObserver to the custom event my_module_event_before and AnotherObserver to my_module_event_after.

Observer names must be unique as per event definition. This means that you cannot have two observers with the same name in the same event definition. In the example, both observers have the name myObserverName. This is acceptable because each of those observers belong to different event definitions.

If you declare an observer with a name that is already in use within the same event, Magento merges these declaration nodes into a single observer declaration, respecting the module load order as defined in the app/etc/config.php file. This is useful when disabling an observer declared in another module.

  • Disabling an observer:

Existing observers can be disabled, if you do not want to have them running. It is a good practice to disable the observer if you want to change its logic rather than override it. Below is an example of how to disable the previously created observer.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="my_module_event_before">
        <observer name="myObserverName" disabled="true" />
    </event>
</config>

How to Use Event and Observer in Magento 2:

We will learn use of Events and Observers in Magento 2 with the examples:-

Example 1- Change product name on product view page.

We will do this by making a separate module. If you want to learn how to create complete module, follow this article.

Step 1: Create Magento 2 Module Structure

1. Create the following folders in the magento project root directory (ex. – C:\xampp\htdocs\magento2):

  • app/code/Thecoachsmb
  • app/code/Thecoachsmb/Mymodule

The Thecoachsmb folder is the module’s VendorName, and Mymodule is the ModuleName.

Note: If you don’t have the code folder in your app directory, create it manually.

Now, create app/code/Thecoachsmb/Mymodule/composer.json:

Contents would be:

{}

This file will be loaded by Composer every-time you run it even though we are not actually using Composer with our module.

Step 2: Declaration of Module

It is necessary to create etc folder and add the module.xml file in it

  app/code/Thecoachsmb/Mymodule/etc/module.xml

Contents would be:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Thecoachsmb_Mymodule" setup_version="1.0.0"/>
 </module> 
</config>

Step 3: Registration of Module

To register the module, create a registration.php file in the app/code/Thecoachsmb/Mymodule/registration.php

Contents would be:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
	\Magento\Framework\Component\ComponentRegistrar::MODULE,
	'Thecoachsmb_Mymodule',
	__DIR__
);

Step 4: Activate the Module

Now its time to enable our moule. Lets check the status of our module by typing below command in the magento project root directory (ex. – C:\xampp\htdocs\magento2) as:

php bin/magento module:status

You should see the module is disabled now:

List of disabled modules: Thecoachsmb_Mymodule

If you get the error “No connection could be made because the target machine actively refused it.” then follow this link.

So lets run the command to enable our module:

php bin/magento module:enable Thecoachsmb_Mymodule

Now that you have enabled the module first time, so you have to upgrade the database of the module by using this command line:

php bin/magento setup:upgrade

Step 5: Create events.xml file to catch event

Magento 2 uses Area Definition to manage the store files. It provides three different areas to create configuration files for the events

Admin area :- Create file under etc/adminhtml folder

Frontend area :- Create file under etc/frontend folder

Global area :- If you want to use Observer in both Admin area and Frontend area ,then create file under

etc/ folder.

In this example, since I want to make changes to the Product Name displayed in the product view, I will use the frontend area.

Create events.xml file in Thecoachsmb/Mymodule/etc/frontend directory and add the following code.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="catalog_controller_product_view">
        <observer name="displayproductdata" instance="Thecoachsmb\Mymodule\Observer\ProductChange" />
    </event> 
</config> 

The above XML code is listening for the catalog_controller_product_view event.

There are name and instance attributes are in the <observer> element. The name attribute defines the Observer Name that must be unique for each event, and the instance attribute defines the specific Magento 2 class that needs to be executed when the catalog_controller_product_view event is dispatched.

Step 6: Create Observer file to catch event.

Create ProductChange.php in app/code/Thecoachsmb/Mymodule/Observer/ folder.

<?php
namespace Thecoachsmb\Mymodule\Observer;
class ProductChange implements \Magento\Framework\Event\ObserverInterface 
{
   public function execute(Magento\Framework\Event\Observer $observer) {
      $product = $observer->getProduct();
      $originalName = $product->getName();
      $updatedName = $originalName . ' - Updated Name';
      $product->setName($updatedName);
   } 
} 

That’s it we are done with observer and events uses for chagning product name. Let’s take one more example to make it clearer to you.

Example 2: Magento 2: Get Customer data after login with observer

Use customer_login event observer for customer login action

Step 1: Create Magento 2 Module Structure

1. Create the following folders in the magento project root directory (ex. – C:\xampp\htdocs\magento2):

  • app/code/Thecoachsmb
  • app/code/Thecoachsmb/CustomerLogin

The Thecoachsmb folder is the module’s VendorName, and CustomerLogin is the ModuleName.

Note: If you don’t have the code folder in your app directory, create it manually.

Now, create app/code/Thecoachsmb/CustomerLogin/composer.json:

Contents would be:

{}

This file will be loaded by Composer every-time you run it even though we are not actually using Composer with our module.

Step 2: Declaration of Module

It is necessary to create etc folder and add the module.xml file in it

  app/code/Thecoachsmb/CustomerLogin/etc/module.xml

Contents would be:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Thecoachsmb_CustomerLogin" setup_version="1.0.0"/>
 </module> 
</config>

Step 3: Registration of Module

To register the module, create a registration.php file in the app/code/Thecoachsmb/CustomerLogin/registration.php

Contents would be:

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
	\Magento\Framework\Component\ComponentRegistrar::MODULE,
	'Thecoachsmb_CustomerLogin',
	__DIR__
);

Step 4: Activate the Module

Now its time to enable our module.

So lets run the command to enable our module:

php bin/magento module:enable Thecoachsmb_CustomerLogin

Now that you have enabled the module first time, so you have to upgrade the database of the module by using this command line:

php bin/magento setup:upgrade

If you get the error “No connection could be made because the target machine actively refused it.” then keep elasticsearch running and also Apache.

Step 5: Create events.xml file to catch event

Magento 2 uses Area Definition to manage the store files. It provides three different areas to create configuration files for the events

Admin area :- Create file under etc/adminhtml folder

Frontend area :- Create file under etc/frontend folder

Global area :- If you want to use Observer in both Admin area and Frontend area ,then create file under

etc/ folder.

In this example, since I want to get the Customer Data, I will use the both frontend and backend area, so scope is global.

Create events.xml file in Thecoachsmb/CustomerLogin/etc directory and add the following code.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="customer_login">
        <observer name="thecoachsmb_customer_login_observer" instance="Thecoachsmb\CustomerLogin\Observer\CustomerLogin" />
    </event> 
</config> 

The above XML code is listening for the customer_login event.

There are name and instance attributes are in the <observer> element. The name attribute defines the Observer Name that must be unique for each event, and the instance attribute defines the specific Magento 2 class that needs to be executed when the customer_loginevent is dispatched.

Step 6: Create Observer file to implement the logic

Create CustomerLogin.php in app/code/Thecoachsmb/CustomerLogin/Observer/ folder.

<?php
namespace Thecoachsmb\CustomerLogin\Observer;
class CustomerLogin implements \Magento\Framework\Event\ObserverInterface 
{
   public function execute(Magento\Framework\Event\Observer $observer) 
   {
         $writer = new \Zend_Log_Writer_Stream(BP . '/var/log/customfile.log');
         $logger = new \Zend_Log();
         $logger->addWriter($writer);$customer = $observer->getEvent()->getCustomer(); 
         $logger->info('Customer Name:- '.print_r($customer->getName(),true));  
        $logger->info('Customer Id:- '.print_r($customer->getId(),true)); 
        $logger->info('Customer Email:- '.print_r($customer->getEmail(),true)); 
        $logger->info('Customer Data:- '.print_r($customer->getData(),true)); 
        return $this;    
 }  
} 

When customer login, you will the customer data in the log file located in <magneto_root_directory>/var/log/customerdata.log as shown below:

 

This is how you can get the complete data of the customer through events.

That’s it we are done with this, it is very simple.

We will Save the value in the custom table in Magento on custom login event.

<?php
namespace Thecoachsmb\CustomerLogin\Observer;

use \Thecoachsmb\Customform\Model\CustomformFactory;

class CustomerLogin implements \Magento\Framework\Event\ObserverInterface 
{
protected $_customform;

public function __construct(CustomformFactory $customform) {
$this->_customform = $customform;
}
public function execute(\Magento\Framework\Event\Observer $observer) 
{
$customer = $observer->getEvent()->getCustomer(); 

// Start :: Log the Data
$writer = new \Zend_Log_Writer_Stream(BP . '/var/log/customfile.log');
$logger = new \Zend_Log();
$logger->addWriter($writer);
$logger->info('Customer Email:- '.print_r($customer->getEmail(),true)); 
// End :: Log the Data
$this->_customform->create()->load(1)->setEmail('test@assets.com')->save();

return $this; 
} 
}

How to get a list of events generated when you perform any action in Magento 2

When there are a thousand lines of code and you want to create a particular event trigger, it becomes difficult to identify what existing events are triggered when you perform any action. And that will take long time to figure it out, so here I came up with a small code that will help you to get a list of events generated when you perform any Action.

To get a list of events we have to perform just two easy steps.

Firstly, we need to create ‘di.xml file inside our extension folder at below path using following code.
app\code\Thecoachsmb\Mymodule\etc\di.xml

Now, we need to create on more file ‘ListDispatchedEvents.php‘ inside our extension folder.
app\code\Thecoachsmb\Mymodule\Plugin\ListDispatchedEvents.php

Your list of events is generated inside an event.log file which resides inside var/log folder. You can use this code anywhere to grab existing events list which triggered when you make any action.

Now I am giving you the complete list of events which are in Magento2.

List all events in Magento 2

Events in PHP Files

  • Event name: sales_quote_remove_item
  • File: vendor/magento/Collect/Model/Quote.php

	$this->_eventManager->dispatch('sales_quote_remove_item', ['quote_item' => $item]);

  • Event name: sales_quote_add_item
  • File: vendor/magento/Collect/Model/Quote.php

	$this->_eventManager->dispatch('sales_quote_add_item', ['quote_item' => $item]);

  • Event name: sales_quote_product_add_after
  • File: vendor/magento/Collect/Model/Quote.php

	$this->_eventManager->dispatch('sales_quote_product_add_after', ['items' => $items]);

  • Event name: _merge_before
  • File: vendor/magento/Collect/Model/Quote.php

	$this->_eventManager->dispatch(
	    $this->_eventPrefix . '_merge_before',
	    [$this->_eventObject => $this, 'source' => $quote]
	);

  • Event name: _merge_after
  • File: vendor/magento/Collect/Model/Quote.php

	$this->_eventManager->dispatch(
	    $this->_eventPrefix . '_merge_after',
	    [$this->_eventObject => $this, 'source' => $quote]
	);

  • Event name: sales_quote_item_qty_set_after
  • File: vendor/magento/Collect/Model/Quote/Item.php

 	$this->_eventManager->dispatch('sales_quote_item_qty_set_after', ['item' => $this]);

  • Event name: sales_quote_item_set_product
  • File: vendor/magento/Collect/Model/Quote/Item.php

	$this->_eventManager->dispatch(
	    'sales_quote_item_set_product',
	    ['product' => $product, 'quote_item' => $this]
	);

  • Event name: _import_data_before
  • File: vendor/magento/Collect/Model/Quote/Payment.php

	$this->_eventManager->dispatch(
	    $this->_eventPrefix . '_import_data_before',
	    [$this->_eventObject => $this, 'input' => $data]
	);

  • Event name: _load_after
  • File: vendor/magento/Collect/Model/ResourceModel/Quote/Address/Collection.php

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

  • Event name: prepare_catalog_product_collection_prices
  • File: vendor/magento/Collect/Model/ResourceModel/Quote/Item/Collection.php

	$this->_eventManager->dispatch(
	    'prepare_catalog_product_collection_prices',
	    ['collection' => $productCollection, 'store_id' => $this->getStoreId()]
	);

  • Event name: sales_quote_item_collection_products_after_load
  • File: vendor/magento/Collect/Model/ResourceModel/Quote/Item/Collection.php

	$this->_eventManager->dispatch(
	    'sales_quote_item_collection_products_after_load',
	    ['collection' => $productCollection]
	);

  • Event name: controller_front_send_response_before
  • File: vendor/magento/framework/App/Http.php

	$this->_eventManager->dispatch('controller_front_send_response_before', $eventParams);

  • Event name: controller_action_layout_render_before
  • File: vendor/magento/framework/App/View.php

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

  • Event name: controller_action_layout_render_before_
  • File: vendor/magento/framework/App/View.php

	$this->_eventManager->dispatch(
	    'controller_action_layout_render_before_' . $this->_request->getFullActionName()
	);

  • Event name: controller_action_predispatch
  • File: vendor/magento/framework/App/Action/Action.php

	$this->_eventManager->dispatch('controller_action_predispatch', $eventParameters);

  • Event name: controller_action_predispatch_
  • File: vendor/magento/framework/App/Action/Action.php

	$this->_eventManager->dispatch('controller_action_predispatch_' . $request->getRouteName(), $eventParameters);

  • Event name: controller_action_predispatch_
  • File: vendor/magento/framework/App/Action/Action.php

	$this->_eventManager->dispatch(
	    'controller_action_predispatch_' . $request->getFullActionName(),
	    $eventParameters
	);

  • Event name: controller_action_postdispatch_
  • File: vendor/magento/framework/App/Action/Action.php

	$this->_eventManager->dispatch(
	  'controller_action_postdispatch_' . $request->getFullActionName(),
	    $eventParameters
	);

  • Event name: controller_action_postdispatch_
  • File: vendor/magento/framework/App/Action/Action.php

	$this->_eventManager->dispatch(
	       'controller_action_postdispatch_' . $request->getRouteName(),
	       $eventParameters
	);

  • Event name: controller_action_postdispatch
  • File: vendor/magento/framework/App/Action/Action.php

	$this->_eventManager->dispatch('controller_action_postdispatch', $eventParameters);

  • Event name: controller_action_noroute
  • File: vendor/magento/framework/Controller/Noroute/Index.php

	$this->_eventManager->dispatch('controller_action_noroute', ['action' => $this, 'status' => $status]);

  • Event name: currency_display_options_forming
  • File: vendor/magento/framework/Locale/Currency.php

	$this->_eventManager->dispatch(
	   'currency_display_options_forming',
	   ['currency_options' => $options, 'base_code' => $currency]
	);

  • Event name: model_load_before
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_load_before', $params);

  • Event name: _load_before
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_load_after
  • File: vendor/magento/framework/Model/AbstractModel.php

	 $this->_eventManager->dispatch('model_load_after', ['object' => $this]);

  • Event name: _load_after
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_save_commit_after
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_save_commit_after', ['object' => $this]);

  • Event name: _save_commit_after
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_save_before
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_save_before', ['object' => $this]);

  • Event name: _save_before
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_save_after
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_save_after', ['object' => $this]);

  • Event name: clean_cache_by_tags
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);

  • Event name: _save_after
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_delete_before
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_delete_before', ['object' => $this]);

  • Event name: _delete_before
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_delete_after
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_delete_after', ['object' => $this]);

  • Event name: clean_cache_by_tags
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);

  • Event name: _delete_after
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: model_delete_commit_after
  • File: vendor/magento/framework/Model/AbstractModel.php

	$this->_eventManager->dispatch('model_delete_commit_after', ['object' => $this]);

  • Event name: _delete_commit_after
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: _clear
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: _clear
  • File: vendor/magento/framework/Model/AbstractModel.php

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

  • Event name: core_collection_abstract_load_before
  • File: vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php

	$this->_eventManager->dispatch('core_collection_abstract_load_before', ['collection' => $this]);

  • Event name: _load_before
  • File: vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php

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

  • Event name: core_collection_abstract_load_after
  • File: vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php

	$this->_eventManager->dispatch('core_collection_abstract_load_after', ['collection' => $this]);

  • Event name: _load_after
  • File: vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php

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

  • Event name: core_layout_render_element
  • File: vendor/magento/framework/View/Layout.php

	$this->_eventManager->dispatch(
            'core_layout_render_element',
            ['element_name' => $name, 'layout' => $this, 'transport' => $this->_renderingOutput]
        );

  • Event name: view_block_abstract_to_html_before
  • File: vendor/magento/framework/View/Element/AbstractBlock.php

	$this->_eventManager->dispatch('view_block_abstract_to_html_before', ['block' => $this]);

  • Event name: view_message_block_render_grouped_html_after
  • File: vendor/magento/framework/View/Element/Messages.php

	$this->_eventManager->dispatch('view_message_block_render_grouped_html_after', $params);

  • Event name: adminhtml_block_html_before
  • File: vendor/magento/module-backend/Block/Template.php

	$this->_eventManager->dispatch('adminhtml_block_html_before', ['block' => $this]);

  • Event name: adminhtml_store_edit_form_prepare_form
  • File: vendor/magento/module-backend/Block/System/Store/Edit/AbstractForm.php

	$this->_eventManager->dispatch('adminhtml_store_edit_form_prepare_form', ['block' => $this]);

  • Event name: backend_block_widget_grid_prepare_grid_before
  • File: vendor/magento/module-backend/Block/Widget/Grid.php

	$this->_eventManager->dispatch(
            'backend_block_widget_grid_prepare_grid_before',
            ['grid' => $this, 'collection' => $this->getCollection()]
        );

  • Event name: clean_catalog_images_cache_after
  • File: vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanImages.php

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

  • Event name: clean_media_cache_after
  • File: vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanMedia.php

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

  • Event name: clean_static_files_cache_after
  • File: vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanStaticFiles.php

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

  • Event name: adminhtml_cache_flush_all
  • File: vendor/magento/module-backend/Controller/Adminhtml/Cache/FlushAll.php

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

  • Event name: adminhtml_cache_flush_system
  • File: vendor/magento/module-backend/Controller/Adminhtml/Cache/FlushSystem.php

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

  • Event name: theme_save_after
  • File: vendor/magento/module-backend/Controller/Adminhtml/System/Design/Save.php

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

  • Event name: store_delete
  • File: vendor/magento/module-backend/Controller/Adminhtml/System/Store/DeleteStorePost.php

	$this->_eventManager->dispatch('store_delete', ['store' => $model]);

  • Event name: store_group_save
  • File: vendor/magento/module-backend/Controller/Adminhtml/System/Store/Save.php

	$this->_eventManager->dispatch('store_group_save', ['group' => $groupModel]);

  • Event name: store_edit
  • File: vendor/magento/module-backend/Controller/Adminhtml/System/Store/Save.php
	$eventName = 'store_edit';
	$this->_eventManager->dispatch($eventName, ['store' => $storeModel]);

  • Event name: store_add
  • File: vendor/magento/module-backend/Controller/Adminhtml/System/Store/Save.php
	$eventName = 'store_add';
	$this->_eventManager->dispatch($eventName, ['store' => $storeModel]);

  • Event name: backend_auth_user_login_success
  • File: vendor/magento/module-backend/Model/Auth.php

	$this->_eventManager->dispatch(
	    'backend_auth_user_login_success',
	    ['user' => $this->getCredentialStorage()]
	);

  • Event name: backend_auth_user_login_failed
  • File: vendor/magento/module-backend/Model/Auth.php

	$this->_eventManager->dispatch(
		'backend_auth_user_login_failed',
		['user_name' => $username, 'exception' => $e]
	);

  • Event name: catalog_product_option_price_configuration_after
  • File: vendor/magento/module-bundle/Block/Catalog/Product/View/Type/Bundle.php

	$this->_eventManager->dispatch('catalog_product_option_price_configuration_after', ['configObj' => $configObj]);

  • Event name: prepare_catalog_product_collection_prices
  • File: vendor/magento/module-bundle/Model/Product/Price.php

	$this->_eventManager->dispatch(
		'prepare_catalog_product_collection_prices',
		['collection' => $selections, 'store_id' => $product->getStoreId()]
	);

  • Event name: catalog_product_get_final_price
  • File: vendor/magento/module-bundle/Model/Product/Price.php

	$this->_eventManager->dispatch('catalog_product_get_final_price', ['product' => $product, 'qty' => $qty]);

  • Event name: catalog_product_prepare_index_select
  • File: vendor/magento/module-bundle/Model/ResourceModel/Indexer/Price.php

        $this->_eventManager->dispatch(
            'catalog_product_prepare_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('e.entity_id'),
                'website_field' => new \Zend_Db_Expr('cw.website_id'),
                'store_field' => new \Zend_Db_Expr('cs.store_id')
            ]
        );

  • Event name: catalog_product_import_bunch_delete_commit_before
  • File: vendor/magento/module-catalog-import-export/Model/Import/Product.php

	$this->_eventManager->dispatch(
	'catalog_product_import_bunch_delete_commit_before',
		[
		    'adapter' => $this,
		    'bunch' => $bunch,
		    'ids_to_delete' => $idsToDelete
		]
	);

  • Event name: catalog_product_import_bunch_delete_after
  • File: vendor/magento/module-catalog-import-export/Model/Import/Product.php

	$this->_eventManager->dispatch('catalog_product_import_bunch_delete_after', ['adapter' => $this, 'bunch' => $bunch]);

  • Event name: catalog_product_import_finish_before
  • File: vendor/magento/module-catalog-import-export/Model/Import/Product.php

	$this->_eventManager->dispatch('catalog_product_import_finish_before', ['adapter' => $this]);

  • Event name: catalog_product_import_bunch_save_after
  • File: vendor/magento/module-catalog-import-export/Model/Import/Product.php

	$this->_eventManager->dispatch(
		'catalog_product_import_bunch_save_after',
		['adapter' => $this, 'bunch' => $bunch]
	);
	
  • Event name: catalogrule_dirty_notice
  • File: vendor/magento/module-catalog-rule/Controller/Adminhtml/Promo/Catalog/Index.php

        $this->_eventManager->dispatch(
            'catalogrule_dirty_notice',
            ['dirty_rules' => $dirtyRules, 'message' => $this->getDirtyRulesNoticeMessage()]
        );
	
  • Event name: adminhtml_controller_catalogrule_prepare_save
  • File: vendor/magento/module-catalog-rule/Controller/Adminhtml/Promo/Catalog/Save.php

	$this->_eventManager->dispatch(
	    'adminhtml_controller_catalogrule_prepare_save',
	    ['request' => $this->getRequest()]
	);
	
  • Event name: clean_cache_by_tags
  • File: vendor/magento/module-catalog-rule/Model/Indexer/AbstractIndexer.php

	$this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);
	
  • Event name: catalogsearch_reset_search_result
  • File: vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext.php

	$this->_eventManager->dispatch('catalogsearch_reset_search_result');
	
  • Event name: shortcut_buttons_container
  • File: vendor/magento/module-catalog/Block/ShortcutButtons.php

        $this->_eventManager->dispatch(
            'shortcut_buttons_container',
            [
                'container' => $this,
                'is_catalog_product' => $this->_isCatalogProduct,
                'or_position' => $this->_orPosition
            ]
        );
	
  • Event name: adminhtml_catalog_category_tree_is_moveable
  • File: vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php

	$this->_eventManager->dispatch('adminhtml_catalog_category_tree_is_moveable', ['options' => $options]);
	
  • Event name: adminhtml_catalog_category_tree_can_add_root_category
  • File: vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php

	$this->_eventManager->dispatch(
            'adminhtml_catalog_category_tree_can_add_root_category',
            ['category' => $this->getCategory(), 'options' => $options, 'store' => $this->getStore()->getId()]
        );
	
  • Event name: adminhtml_catalog_category_tree_can_add_sub_category
  • File: vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php

        $this->_eventManager->dispatch(
            'adminhtml_catalog_category_tree_can_add_sub_category',
            ['category' => $this->getCategory(), 'options' => $options, 'store' => $this->getStore()->getId()]
        );
	
  • Event name: adminhtml_catalog_product_grid_prepare_massaction
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Grid.php

	$this->_eventManager->dispatch('adminhtml_catalog_product_grid_prepare_massaction', ['block' => $this]);
	
  • Event name: product_attribute_grid_build
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Grid.php

	$this->_eventManager->dispatch('product_attribute_grid_build', ['grid' => $this]);
	
  • Event name: product_attribute_form_build
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php

	$this->_eventManager->dispatch('product_attribute_form_build', ['form' => $form]);
	
  • Event name: product_attribute_form_build_front_tab
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php

	$this->_eventManager->dispatch('product_attribute_form_build_front_tab', ['form' => $form]);
	
  • Event name: adminhtml_catalog_product_attribute_edit_frontend_prepare_form
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php

        $this->_eventManager->dispatch(
            'adminhtml_catalog_product_attribute_edit_frontend_prepare_form',
            ['form' => $form, 'attribute' => $attributeObject]
        );
	
  • Event name: adminhtml_product_attribute_types
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php

	$this->_eventManager->dispatch('adminhtml_product_attribute_types', ['response' => $response]);
	
  • Event name: product_attribute_form_build_main_tab
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php

	$this->_eventManager->dispatch('product_attribute_form_build_main_tab', ['form' => $form]);
	
  • Event name: adminhtml_catalog_product_edit_prepare_form
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php

	$this->_eventManager->dispatch('adminhtml_catalog_product_edit_prepare_form', ['form' => $form]);
	
  • Event name: adminhtml_catalog_product_edit_element_types
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php

	$this->_eventManager->dispatch('adminhtml_catalog_product_edit_element_types', ['response' => $response]);
	
  • Event name: adminhtml_catalog_product_attribute_set_main_html_before
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Set/Main.php

        $this->_eventManager->dispatch(
            'adminhtml_catalog_product_attribute_set_main_html_before',
            ['block' => $this]
        );
	
  • Event name: adminhtml_catalog_product_attribute_set_toolbar_main_html_before
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php

        $this->_eventManager->dispatch(
            'adminhtml_catalog_product_attribute_set_toolbar_main_html_before',
            ['block' => $this]
        );
	
  • Event name: adminhtml_catalog_product_form_prepare_excluded_field_list
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php

	$this->_eventManager->dispatch(
	    'adminhtml_catalog_product_form_prepare_excluded_field_list',
	    ['object' => $this]
	);
	
  • Event name: adminhtml_catalog_product_edit_prepare_form
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php

	$this->_eventManager->dispatch(
		'adminhtml_catalog_product_edit_prepare_form',
		['form' => $form, 'layout' => $this->getLayout()]
	);
	
  • Event name: adminhtml_catalog_product_edit_element_types
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php

 	$this->_eventManager->dispatch('adminhtml_catalog_product_edit_element_types', ['response' => $response]);
	
  • Event name: catalog_product_gallery_prepare_layout
  • File: vendor/magento/module-catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php

	$this->_eventManager->dispatch('catalog_product_gallery_prepare_layout', ['block' => $this]);
	
  • Event name: catalog_block_product_status_display
  • File: vendor/magento/module-catalog/Block/Product/AbstractProduct.php

	$this->_eventManager->dispatch('catalog_block_product_status_display', ['status' => $statusInfo]);
	
  • Event name: catalog_block_product_list_collection
  • File: vendor/magento/module-catalog/Block/Product/ListProduct.php

        $this->_eventManager->dispatch(
            'catalog_block_product_list_collection',
            ['collection' => $this->_getProductCollection()]
        );

  • Event name: catalog_product_view_config
  • File: vendor/magento/module-catalog/Block/Product/View.php

	$this->_eventManager->dispatch('catalog_product_view_config', ['response_object' => $responseObject]);

  • Event name: catalog_product_upsell
  • File: vendor/magento/module-catalog/Block/Product/ProductList/Upsell.php

        $this->_eventManager->dispatch(
            'catalog_product_upsell',
            ['product' => $product, 'collection' => $this->_itemCollection, 'limit' => null]
        );

  • Event name: catalog_product_option_price_configuration_after
  • File: vendor/magento/module-catalog/Block/Product/View/Options.php

	$this->_eventManager->dispatch('catalog_product_option_price_configuration_after', ['configObj' => $configObj]);

  • Event name: rss_catalog_category_xml_callback
  • File: vendor/magento/module-catalog/Block/Rss/Category.php

	$this->_eventManager->dispatch('rss_catalog_category_xml_callback', ['product' => $product]);

  • Event name: rss_catalog_new_xml_callback
  • File: vendor/magento/module-catalog/Block/Rss/Product/NewProducts.php

	$this->_eventManager->dispatch('rss_catalog_new_xml_callback', [
		'row' => $item->getData(),
		'product' => $item
	]);

  • Event name: rss_catalog_special_xml_callback
  • File: vendor/magento/module-catalog/Block/Rss/Product/Special.php

	$this->_eventManager->dispatch('rss_catalog_special_xml_callback', [
		'row' => $item->getData(),
		'product' => $item
	]);

  • Event name: category_prepare_ajax_response
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Category.php

        $this->_eventManager->dispatch(
            'category_prepare_ajax_response',
            ['response' => $eventResponse, 'controller' => $this]
        );

  • Event name: catalog_controller_category_delete
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Category/Delete.php

$this->_eventManager->dispatch('catalog_controller_category_delete', ['category' => $category]);

  • Event name: catalog_category_prepare_save
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Category/Save.php

	$this->_eventManager->dispatch(
		'catalog_category_prepare_save',
		['category' => $category, 'request' => $this->getRequest()]
	);

  • Event name: catalog_product_edit_action
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Product/Edit.php

	$this->_eventManager->dispatch('catalog_product_edit_action', ['product' => $product]);

  • Event name: catalog_product_new_action
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Product/NewAction.php

	$this->_eventManager->dispatch('catalog_product_new_action', ['product' => $product]);

  • Event name: controller_action_catalog_product_save_entity_after
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php

	$this->_eventManager->dispatch(
		'controller_action_catalog_product_save_entity_after',
		['controller' => $this, 'product' => $product]
	);

  • Event name: catalog_product_to_website_change
  • File: vendor/magento/module-catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php

	$this->_eventManager->dispatch('catalog_product_to_website_change', ['products' => $productIds]);

  • Event name: catalog_controller_category_init_after
  • File: vendor/magento/module-catalog/Controller/Category/View.php

	$this->_eventManager->dispatch(
		'catalog_controller_category_init_after',
		['category' => $category, 'controller_action' => $this]
	);

  • Event name: catalog_product_compare_add_product
  • File: vendor/magento/module-catalog/Controller/Product/Compare/Add.php

	$this->_eventManager->dispatch('catalog_product_compare_add_product', ['product' => $product]);

  • Event name: catalog_product_compare_remove_product
  • File: vendor/magento/module-catalog/Controller/Product/Compare/Remove.php

	$this->_eventManager->dispatch(
		'catalog_product_compare_remove_product',
		['product' => $item]
	);

  • Event name: catalog_controller_product_init_before
  • File: vendor/magento/module-catalog/Helper/Product.php

        $this->_eventManager->dispatch(
            'catalog_controller_product_init_before',
            ['controller_action' => $controller, 'params' => $params]
        );

  • Event name: catalog_controller_product_init_after
  • File: vendor/magento/module-catalog/Helper/Product.php

	$this->_eventManager->dispatch(
		'catalog_controller_product_init_after',
		['product' => $product, 'controller_action' => $controller]
	);

  • Event name: catalog_controller_product_view
  • File: vendor/magento/module-catalog/Helper/Product/View.php

	$this->_eventManager->dispatch('catalog_controller_product_view', ['product' => $product]);

  • Event name: _move_before
  • File: vendor/magento/module-catalog/Model/Category.php

	$this->_eventManager->dispatch($this->_eventPrefix . '_move_before', $eventParams);

  • Event name: _move_after
  • File: vendor/magento/module-catalog/Model/Category.php

	$this->_eventManager->dispatch($this->_eventPrefix . '_move_after', $eventParams);

  • Event name: category_move
  • File: vendor/magento/module-catalog/Model/Category.php

	$this->_eventManager->dispatch($this->_eventPrefix . 'category_move', $eventParams);

  • Event name: clean_cache_by_tags
  • File: vendor/magento/module-catalog/Model/Category.php

	$this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]);

  • Event name: _validate_before
  • File: vendor/magento/module-catalog/Model/Product.php

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

  • Event name: _validate_after
  • File: vendor/magento/module-catalog/Model/Product.php

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

  • Event name: catalog_product_is_salable_before
  • File: vendor/magento/module-catalog/Model/Product.php

	$this->_eventManager->dispatch('catalog_product_is_salable_before', ['product' => $this]);

  • Event name: catalog_product_is_salable_after
  • File: vendor/magento/module-catalog/Model/Product.php

        $this->_eventManager->dispatch(
            'catalog_product_is_salable_after',
            ['product' => $this, 'salable' => $object]
        );

  • Event name: catalog_product_attribute_update_before
  • File: vendor/magento/module-catalog/Model/Product/Action.php

        $this->_eventManager->dispatch(
            'catalog_product_attribute_update_before',
            ['attributes_data' => &$attrData, 'product_ids' => &$productIds, 'store_id' => &$storeId]
        );

  • Event name: adminhtml_product_attribute_types
  • File: vendor/magento/module-catalog/Model/Product/Attribute/Source/Inputtype.php

	$this->_eventManager->dispatch('adminhtml_product_attribute_types', ['response' => $response]);
	
  • Event name: catalog_product_type_prepare_%s_options
  • File: vendor/magento/module-catalog/Model/Product/Type/AbstractType.php

        $eventName = sprintf('catalog_product_type_prepare_%s_options', $processMode);
        $this->_eventManager->dispatch(
            $eventName,
            ['transport' => $transport, 'buy_request' => $buyRequest, 'product' => $product]
        );
	
  • Event name: catalog_product_get_final_price
  • File: vendor/magento/module-catalog/Model/Product/Type/Price.php

	$this->_eventManager->dispatch('catalog_product_get_final_price', ['product' => $product, 'qty' => $qty]);
	
  • Event name: catalog_category_change_products
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category.php

	$this->_eventManager->dispatch(
		'catalog_category_change_products',
		['category' => $category, 'product_ids' => $productIds]
	);
	
  • Event name: catalog_category_delete_after_done
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category.php

        $this->_eventManager->dispatch(
            'catalog_category_delete_after_done',
            ['product' => $object]
        );
	
  • Event name: _load_before
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php

	$this->_eventManager->dispatch($this->_eventPrefix . '_load_before', [$this->_eventObject => $this]);
	
  • Event name: _load_after
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php

	$this->_eventManager->dispatch($this->_eventPrefix . '_load_after', [$this->_eventObject => $this]);
	
  • Event name: _add_is_active_filter
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php

        $this->_eventManager->dispatch(
            $this->_eventPrefix . '_add_is_active_filter',
            [$this->_eventObject => $this]
        );
	
  • Event name: catalog_category_tree_init_inactive_category_ids
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Flat.php

	$this->_eventManager->dispatch('catalog_category_tree_init_inactive_category_ids', ['tree' => $this]);
	
  • Event name: catalog_category_flat_loadnodes_before
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Flat.php

	$this->_eventManager->dispatch('catalog_category_flat_loadnodes_before', ['select' => $select]);
	
  • Event name: catalog_category_tree_init_inactive_category_ids
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Tree.php

	$this->_eventManager->dispatch('catalog_category_tree_init_inactive_category_ids', ['tree' => $this]);
	
  • Event name: _load_before
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Flat/Collection.php

	$this->_eventManager->dispatch($this->_eventPrefix . '_load_before', [$this->_eventObject => $this]);
	
  • Event name: _load_after
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Flat/Collection.php

	$this->_eventManager->dispatch($this->_eventPrefix . '_load_after', [$this->_eventObject => $this]);
	
  • Event name: _add_is_active_filter
  • File: vendor/magento/module-catalog/Model/ResourceModel/Category/Flat/Collection.php

        $this->_eventManager->dispatch(
            $this->_eventPrefix . '_add_is_active_filter',
            [$this->_eventObject => $this]
        );
	
  • Event name: catalog_prepare_price_select
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php

	$this->_eventManager->dispatch('catalog_prepare_price_select', $eventArgs);
	
  • Event name: catalog_product_collection_load_after
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php

	$this->_eventManager->dispatch('catalog_product_collection_load_after', ['collection' => $this]);
	
  • Event name: catalog_product_collection_before_add_count_to_categories
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php

	$this->_eventManager->dispatch(
		'catalog_product_collection_before_add_count_to_categories',
		['collection' => $this]
	);
	
  • Event name: catalog_product_collection_apply_limitations_after
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php

        $this->_eventManager->dispatch(
            'catalog_product_collection_apply_limitations_after',
            ['collection' => $this]
        );
  • Event name: catalog_product_compare_item_collection_clear
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Compare/Item/Collection.php

	$this->_eventManager->dispatch('catalog_product_compare_item_collection_clear');
  • Event name: prepare_catalog_product_index_select
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php

        $this->_eventManager->dispatch(
            'prepare_catalog_product_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('l.parent_id'),
                'website_field' => new \Zend_Db_Expr('cs.website_id'),
                'store_field' => new \Zend_Db_Expr('cs.store_id')
            ]
        );
  • Event name: prepare_catalog_product_index_select
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Eav/Decimal.php

        $this->_eventManager->dispatch(
            'prepare_catalog_product_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('cpe.entity_id'),
                'website_field' => new \Zend_Db_Expr('cs.website_id'),
                'store_field' => new \Zend_Db_Expr('cs.store_id')
            ]
        );

  • Event name: prepare_catalog_product_index_select
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php

        $this->_eventManager->dispatch(
            'prepare_catalog_product_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('pid.entity_id'),
                'website_field' => new \Zend_Db_Expr('pid.website_id'),
                'store_field' => new \Zend_Db_Expr('pid.store_id')
            ]
        );
		
  • Event name: prepare_catalog_product_index_select
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php

        $this->_eventManager->dispatch(
            'prepare_catalog_product_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('cpe.entity_id'),
                'website_field' => new \Zend_Db_Expr('cs.website_id'),
                'store_field' => new \Zend_Db_Expr('cs.store_id')
            ]
        );
		
  • Event name: prepare_catalog_product_index_select
  • File: vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php

        $this->_eventManager->dispatch(
            'prepare_catalog_product_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('e.entity_id'),
                'website_field' => new \Zend_Db_Expr('cw.website_id'),
                'store_field' => new \Zend_Db_Expr('cs.store_id')
            ]
        );
		
  • Event name: shortcut_buttons_container
  • File: vendor/magento/module-checkout/Block/QuoteShortcutButtons.php

        $this->_eventManager->dispatch(
            'shortcut_buttons_container',
            [
                'container' => $this,
                'is_catalog_product' => $this->_isCatalogProduct,
                'or_position' => $this->_orPosition,
                'checkout_session' => $this->_checkoutSession
            ]
        );
		
  • Event name: checkout_cart_add_product_complete
  • File: vendor/magento/module-checkout/Controller/Cart/Add.php

            $this->_eventManager->dispatch(
                'checkout_cart_add_product_complete',
                ['product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse()]
            );
		
  • Event name: checkout_cart_update_item_complete
  • File: vendor/magento/module-checkout/Controller/Cart/UpdateItemOptions.php

            $this->_eventManager->dispatch(
                'checkout_cart_update_item_complete',
                ['item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse()]
            );
		
  • Event name: checkout_controller_onepage_saveOrder
  • File: vendor/magento/module-checkout/Controller/Onepage/SaveOrder.php

	$this->_eventManager->dispatch(
		'checkout_controller_onepage_saveOrder',
		[
			'result' => $result,
			'action' => $this
		]
	);
		
  • Event name: checkout_onepage_controller_success_action
  • File: vendor/magento/module-checkout/Controller/Onepage/Success.php

	$this->_eventManager->dispatch(
		'checkout_onepage_controller_success_action',
		['order_ids' => [$session->getLastOrderId()]]
	);
		
  • Event name: checkout_allow_guest
  • File: vendor/magento/module-checkout/Helper/Data.php

	$this->_eventManager->dispatch(
		'checkout_allow_guest',
		['quote' => $quote, 'store' => $store, 'result' => $result]
	);
		
  • Event name: checkout_cart_product_add_after
  • File: vendor/magento/module-checkout/Model/Cart.php

	$this->_eventManager->dispatch(
		'checkout_cart_product_add_after',
		['quote_item' => $result, 'product' => $product]
	);
		
  • Event name: checkout_cart_update_items_before
  • File: vendor/magento/module-checkout/Model/Cart.php

	$this->_eventManager->dispatch(
		'checkout_cart_update_items_before',
		['cart' => $this, 'info' => $infoDataObject]
	);
		
  • Event name: checkout_cart_update_items_after
  • File: vendor/magento/module-checkout/Model/Cart.php

	$this->_eventManager->dispatch(
		'checkout_cart_update_items_after',
		['cart' => $this, 'info' => $infoDataObject]
	);

		
  • Event name: checkout_cart_save_before
  • File: vendor/magento/module-checkout/Model/Cart.php

	$this->_eventManager->dispatch('checkout_cart_save_before', ['cart' => $this]);
		
  • Event name: checkout_cart_save_after
  • File: vendor/magento/module-checkout/Model/Cart.php

	$this->_eventManager->dispatch('checkout_cart_save_after', ['cart' => $this]);
		
  • Event name: checkout_cart_product_update_after
  • File: vendor/magento/module-checkout/Model/Cart.php

	$this->_eventManager->dispatch(
		'checkout_cart_product_update_after',
		['quote_item' => $result, 'product' => $product]
	);
		
  • Event name: custom_quote_process
  • File: vendor/magento/module-checkout/Model/Session.php

	$this->_eventManager->dispatch('custom_quote_process', ['checkout_session' => $this]);
		
  • Event name: checkout_quote_init
  • File: vendor/magento/module-checkout/Model/Session.php

	$this->_eventManager->dispatch('checkout_quote_init', ['quote' => $quote]);
		
  • Event name: load_customer_quote_before
  • File: vendor/magento/module-checkout/Model/Session.php

	$this->_eventManager->dispatch('load_customer_quote_before', ['checkout_session' => $this]);
		
  • Event name: checkout_quote_destroy
  • File: vendor/magento/module-checkout/Model/Session.php

	$this->_eventManager->dispatch('checkout_quote_destroy', ['quote' => $this->getQuote()]);
		
  • Event name: restore_quote
  • File: vendor/magento/module-checkout/Model/Session.php

	$this->_eventManager->dispatch('restore_quote', ['order' => $order, 'quote' => $quote]);
		
  • Event name: checkout_type_onepage_save_order_after
  • File: vendor/magento/module-checkout/Model/Type/Onepage.php

	$this->_eventManager->dispatch(
		'checkout_type_onepage_save_order_after',
		['order' => $order, 'quote' => $this->getQuote()]
	);

  • Event name: checkout_submit_all_after
  • File: vendor/magento/module-checkout/Model/Type/Onepage.php

	$this->_eventManager->dispatch(
		'checkout_submit_all_after',
		[
			'order' => $order,
			'quote' => $this->getQuote()
		]
	);

  • Event name: cms_controller_router_match_before
  • File: vendor/magento/module-cms/Controller/Router.php

	$this->_eventManager->dispatch(
		'cms_controller_router_match_before',
		['router' => $this, 'condition' => $condition]
	);

  • Event name: adminhtml_cmspage_on_delete
  • File: vendor/magento/module-cms/Controller/Adminhtml/Page/Delete.php

	$this->_eventManager->dispatch(
		'adminhtml_cmspage_on_delete',
		['title' => $title, 'status' => 'success']
	);

  • Event name: adminhtml_cmspage_on_delete
  • File: vendor/magento/module-cms/Controller/Adminhtml/Page/Delete.php

	$this->_eventManager->dispatch(
		'adminhtml_cmspage_on_delete',
		['title' => $title, 'status' => 'fail']
	);

  • Event name: cms_page_prepare_save
  • File: vendor/magento/module-cms/Controller/Adminhtml/Page/Save.php

	$this->_eventManager->dispatch(
		'cms_page_prepare_save',
		['page' => $model, 'request' => $this->getRequest()]
	);

  • Event name: cms_page_render
  • File: vendor/magento/module-cms/Helper/Page.php

	$this->_eventManager->dispatch(
		'cms_page_render',
		['page' => $this->_page, 'controller_action' => $action]
	);

  • Event name: cms_wysiwyg_images_static_urls_allowed
  • File: vendor/magento/module-cms/Helper/Wysiwyg/Images.php

	$this->_eventManager->dispatch(
		'cms_wysiwyg_images_static_urls_allowed',
		['result' => $checkResult, 'store_id' => $this->_storeId]
	);

  • Event name: adminhtml_system_config_advanced_disableoutput_render_before
  • File: vendor/magento/module-config/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php

	$this->_eventManager->dispatch(
		'adminhtml_system_config_advanced_disableoutput_render_before',
		['modules' => $dispatchResult]
	);

  • Event name: admin_system_config_changed_section_
  • File: vendor/magento/module-config/Model/Config.php

	$this->_eventManager->dispatch(
		"admin_system_config_changed_section_{$this->getSection()}",
		['website' => $this->getWebsite(), 'store' => $this->getStore()]
	);

  • Event name: controller_action_nocookies
  • File: vendor/magento/module-cookie/Controller/Index/NoCookies.php

	$this->_eventManager->dispatch(
		'controller_action_nocookies',
		['action' => $this, 'redirect' => $redirect]
	);

  • Event name: admin_system_config_changed_section_currency_before_reinit
  • File: vendor/magento/module-currency-symbol/Model/System/Currencysymbol.php

	$this->_eventManager->dispatch(
		'admin_system_config_changed_section_currency_before_reinit',
		['website' => $this->_websiteId, 'store' => $this->_storeId]
	);

  • Event name: adminhtml_block_html_before
  • File: vendor/magento/module-customer/Block/Adminhtml/Edit/Tab/Carts.php

	$this->_eventManager->dispatch('adminhtml_block_html_before', ['block' => $this]);

  • Event name: customer_register_success
  • File: vendor/magento/module-customer/Controller/Account/CreatePost.php

	$this->_eventManager->dispatch(
		'customer_register_success',
		['account_controller' => $this, 'customer' => $customer]
	);

  • Event name: customer_account_edited
  • File: vendor/magento/module-customer/Controller/Account/EditPost.php

	$this->_eventManager->dispatch(
		'customer_account_edited',
		['email' => $customerCandidateDataObject->getEmail()]
	);

  • Event name: adminhtml_customer_prepare_save
  • File: vendor/magento/module-customer/Controller/Adminhtml/Index/Save.php

	$this->_eventManager->dispatch(
		'adminhtml_customer_prepare_save',
		['customer' => $customer, 'request' => $this->getRequest()]
	);

  • Event name: adminhtml_customer_save_after
  • File: vendor/magento/module-customer/Controller/Adminhtml/Index/Save.php

	$this->_eventManager->dispatch(
		'adminhtml_customer_save_after',
		['customer' => $customer, 'request' => $this->getRequest()]
	);

  • Event name: customer_customer_authenticated
  • File: vendor/magento/module-customer/Model/Customer.php

	$this->_eventManager->dispatch(
		'customer_customer_authenticated',
		['model' => $this, 'password' => $password]
	);

  • Event name: customer_session_init
  • File: vendor/magento/module-customer/Model/Session.php

	$this->_eventManager->dispatch('customer_session_init', ['customer_session' => $this]);

  • Event name: customer_login
  • File: vendor/magento/module-customer/Model/Session.php

	$this->_eventManager->dispatch('customer_login', ['customer' => $customer]);

  • Event name: customer_data_object_login
  • File: vendor/magento/module-customer/Model/Session.php

	$this->_eventManager->dispatch('customer_data_object_login', ['customer' => $this->getCustomerDataObject()]);

  • Event name: customer_logout
  • File: vendor/magento/module-customer/Model/Session.php

	$this->_eventManager->dispatch('customer_logout', ['customer' => $this->getCustomer()]);

  • Event name: visitor_init
  • File: vendor/magento/module-customer/Model/Visitor.php

	$this->_eventManager->dispatch('visitor_init', ['visitor' => $this]);

  • Event name: visitor_activity_save
  • File: vendor/magento/module-customer/Model/Visitor.php

	$this->_eventManager->dispatch('visitor_activity_save', ['visitor' => $this]);

  • Event name: customer_address_format
  • File: vendor/magento/module-customer/Model/Address/AbstractAddress.php

	 $this->_eventManager->dispatch('customer_address_format', ['type' => $formatType, 'address' => $this]);

  • Event name: adminhtml_block_eav_attribute_edit_form_init
  • File: vendor/magento/module-eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php

	$this->_eventManager->dispatch(
		'adminhtml_block_eav_attribute_edit_form_init',
		['form' => $this->getForm()]
	);

  • Event name: eav_collection_abstract_load_before
  • File: vendor/magento/module-eav/Model/Entity/Collection/AbstractCollection.php

	$this->_eventManager->dispatch('eav_collection_abstract_load_before', ['collection' => $this]);

  • Event name: gift_options_prepare_items
  • File: vendor/magento/module-gift-message/Block/Message/Inline.php

	$this->_eventManager->dispatch('gift_options_prepare_items', ['items' => $entityItems]);

  • Event name: catalog_product_prepare_index_select
  • File: vendor/magento/module-grouped-product/Model/ResourceModel/Product/Indexer/Price/Grouped.php

        $this->_eventManager->dispatch(
            'catalog_product_prepare_index_select',
            [
                'select' => $select,
                'entity_field' => new \Zend_Db_Expr('e.entity_id'),
                'website_field' => new \Zend_Db_Expr('cw.website_id'),
                'store_field' => new \Zend_Db_Expr('cs.store_id')
            ]
        );

  • Event name: checkout_controller_multishipping_shipping_post
  • File: vendor/magento/module-multishipping/Controller/Checkout/ShippingPost.php

	$this->_eventManager->dispatch(
		'checkout_controller_multishipping_shipping_post',
		['request' => $this->getRequest(), 'quote' => $this->_getCheckout()->getQuote()]
	);

  • Event name: multishipping_checkout_controller_success_action
  • File: vendor/magento/module-multishipping/Controller/Checkout/Success.php

	$this->_eventManager->dispatch('multishipping_checkout_controller_success_action', ['order_ids' => $ids]);

  • Event name: checkout_type_multishipping_set_shipping_items
  • File: vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

	$this->_eventManager->dispatch('checkout_type_multishipping_set_shipping_items', ['quote' => $quote]);

  • Event name: checkout_type_multishipping_create_orders_single
  • File: vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

	$this->_eventManager->dispatch(
		'checkout_type_multishipping_create_orders_single',
		['order' => $order, 'address' => $address, 'quote' => $this->getQuote()]
	);

  • Event name: checkout_submit_all_after
  • File: vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

	$this->_eventManager->dispatch(
		'checkout_submit_all_after',
		['orders' => $orders, 'quote' => $this->getQuote()]
	);

  • Event name: checkout_multishipping_refund_all
  • File: vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

	$this->_eventManager->dispatch('checkout_multishipping_refund_all', ['orders' => $orders]);

  • Event name: payment_form_block_to_html_before
  • File: vendor/magento/module-payment/Block/Form/Cc.php

	$this->_eventManager->dispatch('payment_form_block_to_html_before', ['block' => $this]);

  • Event name: payment_cart_collect_items_and_amounts
  • File: vendor/magento/module-payment/Model/Cart.php

	$this->_eventManager->dispatch('payment_cart_collect_items_and_amounts', ['cart' => $this]);

  • Event name: payment_method_assign_data_
  • File: vendor/magento/module-payment/Model/Method/AbstractMethod.php

	$this->_eventManager->dispatch(
		'payment_method_assign_data_' . $this->getCode(),
		[
			AbstractDataAssignObserver::METHOD_CODE => $this,
			AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(),
			AbstractDataAssignObserver::DATA_CODE => $data
		]
	);

  • Event name: payment_method_assign_data
  • File: vendor/magento/module-payment/Model/Method/AbstractMethod.php

	$this->_eventManager->dispatch(
		'payment_method_assign_data',
		[
			AbstractDataAssignObserver::METHOD_CODE => $this,
			AbstractDataAssignObserver::MODEL_CODE => $this->getInfoInstance(),
			AbstractDataAssignObserver::DATA_CODE => $data
		]
	);

  • Event name: payment_method_is_active
  • File: vendor/magento/module-payment/Model/Method/AbstractMethod.php

	$this->_eventManager->dispatch(
		'payment_method_is_active',
		[
			'result' => $checkResult,
			'method_instance' => $this,
			'quote' => $quote
		]
	);

  • Event name: paypal_express_place_order_success
  • File: vendor/magento/module-paypal/Controller/Express/AbstractExpress/PlaceOrder.php

	$this->_eventManager->dispatch(
		'paypal_express_place_order_success',
			[
	    			'order' => $order,
	    			'quote' => $this->_getQuote()
			]
	);

  • Event name: persistent_session_expired
  • File: vendor/magento/module-persistent/Controller/Index/UnsetCookie.php

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

  • Event name: persistent_session_expired
  • File: vendor/magento/module-persistent/Observer/CheckExpirePersistentQuoteObserver.php

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

  • Event name: sales_quote_remove_item
  • File: vendor/magento/module-quote/Model/Quote.php

	$this->_eventManager->dispatch('sales_quote_remove_item', ['quote_item' => $item]);

  • Event name: sales_quote_add_item
  • File: vendor/magento/module-quote/Model/Quote.php

	$this->_eventManager->dispatch('sales_quote_add_item', ['quote_item' => $item]);

  • Event name: sales_quote_product_add_after
  • File: vendor/magento/module-quote/Model/Quote.php

	$this->_eventManager->dispatch('sales_quote_product_add_after', ['items' => $items]);

  • Event name: _merge_before
  • File: vendor/magento/module-quote/Model/Quote.php

	$this->_eventManager->dispatch(
		$this->_eventPrefix . '_merge_before',
		[$this->_eventObject => $this, 'source' => $quote]
	);

  • Event name: _merge_after
  • File: vendor/magento/module-quote/Model/Quote.php

	$this->_eventManager->dispatch(
		$this->_eventPrefix . '_merge_after',
		[$this->_eventObject => $this, 'source' => $quote]
	);

  • Event name: sales_quote_item_qty_set_after
  • File: vendor/magento/module-quote/Model/Quote/Item.php

	$this->_eventManager->dispatch('sales_quote_item_qty_set_after', ['item' => $this]);

  • Event name: sales_quote_item_set_product
  • File: vendor/magento/module-quote/Model/Quote/Item.php

	$this->_eventManager->dispatch(
		'sales_quote_item_set_product',
		['product' => $product, 'quote_item' => $this]
	);

  • Event name: _import_data_before
  • File: vendor/magento/module-quote/Model/Quote/Payment.php

	$this->_eventManager->dispatch(
		$this->_eventPrefix . '_import_data_before',
		[$this->_eventObject => $this, 'input' => $data]
	);

  • Event name: _load_after
  • File: vendor/magento/module-quote/Model/ResourceModel/Quote/Address/Collection.php

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

  • Event name: prepare_catalog_product_collection_prices
  • File: vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php

	$this->_eventManager->dispatch(
		'prepare_catalog_product_collection_prices',
		['collection' => $productCollection, 'store_id' => $this->getStoreId()]
	);

  • Event name: sales_quote_item_collection_products_after_load
  • File: vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php

	$this->_eventManager->dispatch(
		'sales_quote_item_collection_products_after_load',
		['collection' => $productCollection]
	);

  • Event name: adminhtml_widget_grid_filter_collection
  • File: vendor/magento/module-reports/Block/Adminhtml/Grid.php

	$this->_eventManager->dispatch(
		'adminhtml_widget_grid_filter_collection',
		['collection' => $this->getCollection(), 'filter_values' => $this->_filterValues]
	);

  • Event name: sales_prepare_amount_expression
  • File: vendor/magento/module-reports/Model/ResourceModel/Order/Collection.php

	$this->_eventManager->dispatch(
		'sales_prepare_amount_expression',
		['collection' => $this, 'expression_object' => $expressionTransferObject]
	);

  • Event name: review_controller_product_init_before
  • File: vendor/magento/module-review/Controller/Product.php

	$this->_eventManager->dispatch('review_controller_product_init_before', ['controller_action' => $this]);

  • Event name: review_controller_product_init
  • File: vendor/magento/module-review/Controller/Product.php

	$this->_eventManager->dispatch('review_controller_product_init', ['product' => $product]);

  • Event name: review_controller_product_init_after
  • File: vendor/magento/module-review/Controller/Product.php

	$this->_eventManager->dispatch(
		'review_controller_product_init_after',
		['product' => $product, 'controller_action' => $this]
	);

  • Event name: rating_rating_collection_load_before
  • File: vendor/magento/module-review/Model/ResourceModel/Rating/Collection.php

	$this->_eventManager->dispatch('rating_rating_collection_load_before', ['collection' => $this]);

  • Event name: review_review_collection_load_before
  • File: vendor/magento/module-review/Model/ResourceModel/Review/Collection.php

	$this->_eventManager->dispatch('review_review_collection_load_before', ['collection' => $this]);

  • Event name: adminhtml_block_salesrule_actions_prepareform
  • File: vendor/magento/module-sales-rule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php

	$this->_eventManager->dispatch('adminhtml_block_salesrule_actions_prepareform', ['form' => $form]);

  • Event name: adminhtml_promo_quote_edit_tab_coupons_form_prepare_form
  • File: vendor/magento/module-sales-rule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php

	$this->_eventManager->dispatch(
		'adminhtml_promo_quote_edit_tab_coupons_form_prepare_form',
		['form' => $form]
	);

  • Event name: adminhtml_block_promo_widget_chooser_prepare_collection
  • File: vendor/magento/module-sales-rule/Block/Adminhtml/Promo/Widget/Chooser.php

	$this->_eventManager->dispatch(
		'adminhtml_block_promo_widget_chooser_prepare_collection',
		['collection' => $collection]
	);

  • Event name: adminhtml_controller_salesrule_prepare_save
  • File: vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php

	$this->_eventManager->dispatch(
		'adminhtml_controller_salesrule_prepare_save',
		['request' => $this->getRequest()]
	);

  • Event name: salesrule_rule_get_coupon_types
  • File: vendor/magento/module-sales-rule/Model/Rule.php

	$this->_eventManager->dispatch('salesrule_rule_get_coupon_types', ['transport' => $transport]);

  • Event name: salesrule_validator_process
  • File: vendor/magento/module-sales-rule/Model/RulesApplier.php

	$this->_eventManager->dispatch(
		'salesrule_validator_process',
		[
			'rule' => $rule,
			'item' => $item,
			'address' => $address,
			'quote' => $quote,
			'qty' => $qty,
			'result' => $discountData
		]
	);

  • Event name: salesrule_rule_condition_combine
  • File: vendor/magento/module-sales-rule/Model/Rule/Condition/Combine.php

	$this->_eventManager->dispatch('salesrule_rule_condition_combine', ['additional' => $additional]);

  • Event name: adminhtml_customer_orders_add_action_renderer
  • File: vendor/magento/module-sales/Block/Adminhtml/Reorder/Renderer/Action.php

	$this->_eventManager->dispatch(
		'adminhtml_customer_orders_add_action_renderer',
		['renderer' => $this, 'row' => $row]
	);

  • Event name: admin_sales_order_address_update
  • File: vendor/magento/module-sales/Controller/Adminhtml/Order/AddressSave.php

	$this->_eventManager->dispatch(
		'admin_sales_order_address_update',
		[
			'order_id' => $address->getParentId()
		]
	);

  • Event name: adminhtml_sales_order_create_process_data_before
  • File: vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php

	$this->_eventManager->dispatch('adminhtml_sales_order_create_process_data_before', $eventData);

  • Event name: adminhtml_sales_order_create_process_data
  • File: vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php

	$this->_eventManager->dispatch('adminhtml_sales_order_create_process_data', $eventData);

  • Event name: sales_order_place_before
  • File: vendor/magento/module-sales/Model/Order.php

	$this->_eventManager->dispatch('sales_order_place_before', ['order' => $this]);

  • Event name: sales_order_place_after
  • File: vendor/magento/module-sales/Model/Order.php

	$this->_eventManager->dispatch('sales_order_place_after', ['order' => $this]);

  • Event name: order_cancel_after
  • File: vendor/magento/module-sales/Model/Order.php

	$this->_eventManager->dispatch('order_cancel_after', ['order' => $this]);

  • Event name: sales_convert_order_to_quote
  • File: vendor/magento/module-sales/Model/AdminOrder/Create.php

	$this->_eventManager->dispatch('sales_convert_order_to_quote', ['order' => $order, 'quote' => $quote]);

  • Event name: sales_convert_order_item_to_quote_item
  • File: vendor/magento/module-sales/Model/AdminOrder/Create.php

	$this->_eventManager->dispatch(
		'sales_convert_order_item_to_quote_item',
		['order_item' => $orderItem, 'quote_item' => $item]
	);

  • Event name: checkout_submit_all_after
  • File: vendor/magento/module-sales/Model/AdminOrder/Create.php

	$this->_eventManager->dispatch('checkout_submit_all_after', ['order' => $order, 'quote' => $quote]);

  • Event name: _sales_email_general_async_sending_
  • File: vendor/magento/module-sales/Model/Config/Backend/Email/AsyncSending.php

	$this->_eventManager->dispatch(
		$this->_eventPrefix . '_sales_email_general_async_sending_' . $state,
		$this->_getEventData()
	);

  • Event name: _dev_grid_async_indexing_
  • File: vendor/magento/module-sales/Model/Config/Backend/Grid/AsyncIndexing.php

	$this->_eventManager->dispatch(
		$this->_eventPrefix . '_dev_grid_async_indexing_' . $state,
		$this->_getEventData()
	);

  • Event name: sales_order_invoice_pay
  • File: vendor/magento/module-sales/Model/Order/Invoice.php

	$this->_eventManager->dispatch('sales_order_invoice_pay', [$this->_eventObject => $this]);

  • Event name: sales_order_invoice_cancel
  • File: vendor/magento/module-sales/Model/Order/Invoice.php

	$this->_eventManager->dispatch('sales_order_invoice_cancel', [$this->_eventObject => $this]);

  • Event name: sales_order_invoice_register
  • File: vendor/magento/module-sales/Model/Order/Invoice.php

	$this->_eventManager->dispatch(
		'sales_order_invoice_register',
		[$this->_eventObject => $this, 'order' => $order]
	);

  • Event name: sales_order_item_cancel
  • File: vendor/magento/module-sales/Model/Order/Item.php

	$this->_eventManager->dispatch('sales_order_item_cancel', ['item' => $this]);

  • Event name: sales_order_payment_place_start
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);

  • Event name: sales_order_payment_place_end
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);

  • Event name: sales_order_payment_cancel_invoice
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch(
		'sales_order_payment_cancel_invoice',
		['payment' => $this, 'invoice' => $invoice]
	);

  • Event name: sales_order_payment_void
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch('sales_order_payment_void', ['payment' => $this, 'invoice' => $document]);

  • Event name: sales_order_payment_refund
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch(
		'sales_order_payment_refund',
		['payment' => $this, 'creditmemo' => $creditmemo]
	);

  • Event name: sales_order_payment_cancel_creditmemo
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch(
		'sales_order_payment_cancel_creditmemo',
		['payment' => $this, 'creditmemo' => $creditmemo]
	);

  • Event name: sales_order_payment_cancel
  • File: vendor/magento/module-sales/Model/Order/Payment.php

	$this->_eventManager->dispatch('sales_order_payment_cancel', ['payment' => $this]);

  • Event name: sales_order_status_unassign
  • File: vendor/magento/module-sales/Model/Order/Status.php

	$this->_eventManager->dispatch(
		'sales_order_status_unassign',
		[
			'status' => $this->getStatus(),
			'state' => $state
		]
	);

  • Event name: _html_txn_id
  • File: vendor/magento/module-sales/Model/Order/Payment/Transaction.php

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

  • Event name: _load_after
  • File: vendor/magento/module-sales/Model/ResourceModel/Order/Address/Collection.php

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

  • Event name: _set_sales_order
  • FilePath: vendor/magento/module-sales/Model/ResourceModel/Order/Collection/AbstractCollection.php
	$this->_eventManager->dispatch(
		$this->_eventPrefix . '_set_sales_order',
		['collection' => $this, $this->_eventObject => $this, 'order' => $order]
	);
  • Event name: sales_sale_collection_query_before
  • FilePath: vendor/magento/module-sales/Model/ResourceModel/Sale/Collection.php
	$this->_eventManager->dispatch('sales_sale_collection_query_before', ['collection' => $this]);
  • Event name: on_view_report
  • FilePath: vendor/magento/module-search/Controller/Adminhtml/Term/Report.php
	$this->_eventManager->dispatch('on_view_report', ['report' => 'search']);
  • Event name: sendfriend_product
  • FilePath: vendor/magento/module-send-friend/Controller/Product/Send.php
	$this->_eventManager->dispatch('sendfriend_product', ['product' => $product]);
  • Event name: swatch_gallery_upload_image_after
  • FilePath: vendor/magento/module-swatches/Controller/Adminhtml/Iframe/Show.php
	$this->_eventManager->dispatch(
		'swatch_gallery_upload_image_after',
		['result' => $result, 'action' => $this]
	);
  • Event name: adminhtml_cache_refresh_type
  • FilePath: vendor/magento/module-tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php
	$this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => 'block_html']);
  • Event name: tax_rate_data_fetch
  • FilePath: vendor/magento/module-tax/Model/Calculation.php
	$this->_eventManager->dispatch('tax_rate_data_fetch', ['request' => $request, 'sender' => $this]);
  • Event name: tax_settings_change_after
  • FilePath: vendor/magento/module-tax/Model/Calculation/Rate.php
	$this->_eventManager->dispatch('tax_settings_change_after');
  • Event name: page_block_html_topmenu_gethtml_before
  • FilePath: vendor/magento/module-theme/Block/Html/Topmenu.php
	$this->_eventManager->dispatch(
		'page_block_html_topmenu_gethtml_before',
		['menu' => $this->_menu, 'block' => $this]
	);
  • Event name: page_block_html_topmenu_gethtml_after
  • FilePath: vendor/magento/module-theme/Block/Html/Topmenu.php
	$this->_eventManager->dispatch(
		'page_block_html_topmenu_gethtml_after',
		['menu' => $this->_menu, 'transportObject' => $transportObject]
	);
  • Event name: assign_theme_to_stores_after
  • FilePath: vendor/magento/module-theme/Model/Config.php
        $this->_eventManager->dispatch(
            'assign_theme_to_stores_after',
            ['stores' => $stores, 'scope' => $scope, 'theme' => $theme]
        );
  • Event name: permissions_role_html_before
  • FilePath: vendor/magento/module-user/Block/Role.php
	$this->_eventManager->dispatch('permissions_role_html_before', ['block' => $this]);
  • Event name: admin_permissions_role_prepare_save
  • FilePath: vendor/magento/module-user/Controller/Adminhtml/User/Role/SaveRole.php
	$this->_eventManager->dispatch(
		'admin_permissions_role_prepare_save',
		['object' => $role, 'request' => $this->getRequest()]
	);
  • Event name: admin_user_authenticate_before
  • FilePath: vendor/magento/module-user/Model/User.php
	$this->_eventManager->dispatch(
		'admin_user_authenticate_before',
		['username' => $username, 'user' => $this]
	);
  • Event name: admin_user_authenticate_after
  • FilePath: vendor/magento/module-user/Model/User.php
	$this->_eventManager->dispatch(
		'admin_user_authenticate_after',
		['username' => $username, 'password' => $password, 'user' => $this, 'result' => $result]
	);
  • Event name: admin_user_authenticate_after
  • FilePath: vendor/magento/module-user/Model/User.php
	$this->_eventManager->dispatch(
		'admin_user_authenticate_after',
		[
			'username' => $this->getUserName(),
			'password' => $passwordString,
			'user' => $this,
			'result' => $isCheckSuccessful
		]
	);
  • Event name: product_option_renderer_init
  • FilePath: vendor/magento/module-wishlist/Block/Customer/Wishlist/Item/Options.php
	$this->_eventManager->dispatch('product_option_renderer_init', ['block' => $this]);
  • Event name: wishlist_add_product
  • FilePath: vendor/magento/module-wishlist/Controller/Index/Add.php
    $this->_eventManager->dispatch(
	'wishlist_add_product',
	['wishlist' => $wishlist, 'product' => $product, 'item' => $result]
    );
  • Event name: wishlist_share
  • FilePath: vendor/magento/module-wishlist/Controller/Index/Send.php
	$this->_eventManager->dispatch('wishlist_share', ['wishlist' => $wishlist]);
  • Event name: wishlist_items_renewed
  • FilePath: vendor/magento/module-wishlist/Helper/Data.php
	$this->_eventManager->dispatch('wishlist_items_renewed');
  • Event name: wishlist_product_add_after
  • FilePath: vendor/magento/module-wishlist/Model/Wishlist.php
	$this->_eventManager->dispatch('wishlist_product_add_after', ['items' => $items]);
  • Event name: wishlist_item_collection_products_after_load
  • FilePath: vendor/magento/module-wishlist/Model/ResourceModel/Item/Collection.php
	$this->_eventManager->dispatch(
		'wishlist_item_collection_products_after_load',
		['product_collection' => $productCollection]
	);

JavaScript Varien Events

  • Event name: formSubmit
  • FilePath: lib/web/mage/adminhtml/form.js
	varienGlobalEvents.fireEvent("formSubmit", $(e.target).attr('id'));
  • Event name: address_country_changed
  • FilePath: lib/web/mage/adminhtml/form.js
	varienGlobalEvents.fireEvent("address_country_changed", this.countryEl);
  • Event name: gridRowClick
  • FilePath: lib/web/mage/adminhtml/grid.js
	varienGlobalEvents.fireEvent('gridRowClick', event);
  • Event name: gridRowDblClick
  • FilePath: lib/web/mage/adminhtml/grid.js
	varienGlobalEvents.fireEvent('gridRowDblClick', event);
  • Event name: tinymceChange
  • FilePath: lib/web/mage/adminhtml/wysiwyg/widget.js
	 varienGlobalEvents.fireEvent('tinymceChange');
  • Event name: tinymceSubmit
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymceSubmit', e);
  • Event name: tinymcePaste
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymcePaste', o);
  • Event name: tinymceBeforeSetContent
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymceBeforeSetContent', o);
  • Event name: tinymceSetContent
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymceSetContent', o);
  • Event name: tinymceSetContent
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymceSaveContent', o);
  • Event name: tinymceChange
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymceChange', l);
  • Event name: tinymceExecCommand
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	 varienGlobalEvents.fireEvent('tinymceExecCommand', cmd);
  • Event name: open_browser_callback
  • FilePath: lib/web/mage/adminhtml/wysiwyg/tiny_mce/setup.js
	varienGlobalEvents.fireEvent("open_browser_callback", {
		win: w,
		type: objectType,
		field: fieldName
	});

Hope you liked the article, do comment below giving feedback.

Happy Learning !!
Thank You !!

Sonal Motghare-Balpande
Sonal Motghare-Balpande

Hello Readers, With over 14 years of experience as a PHP expert and a Magento Certified Professional, I bring both technical mastery and a passion for growth. Beyond coding, I embrace a healthy lifestyle and believe in the transformative power of knowledge. My mission is to empower others through guidance because true success lies in sharing what we know. Let’s grow together— https://www.facebook.com/SonalMotghareBalpande/ https://www.linkedin.com/in/sonalmotgharebalpande/ https://www.instagram.com/sonalmotgharebalpande/ Thank You, Sonal

One thought on “Events and Observers in Magento2

Leave a Reply

Your email address will not be published. Required fields are marked *