List of events

This is the list of event names ordered alphabetically. Each event contains a short description and a list of supported arguments.

Reference

abstract_search_result_load_after

Use cases

To modify product stock items and stock statuses.

Origins

\Magento\Framework\Data\AbstractSearchResult:

protected function afterLoad()
{
   $this->eventManager->dispatch('abstract_search_result_load_after', ['collection' => $this]);

Examples of classes that raise the event

abstract_search_result_load_before

Use cases

To modify product stock items and stock statuses.

Origins

\Magento\Framework\Data\AbstractSearchResult:

protected function beforeLoad()
{
$this->eventManager->dispatch('abstract_search_result_load_before', ['collection' => $this]);

Classes raising the event

adminhtml_block_eav_attribute_edit_form_init

Use cases

To modify backend attribute edit page form.

Origins

\Magento\Eav\Block\Adminhtml\Attribute\Edit\Main\AbstractMain:

protected function _initFormValue()
{
$this->eventManager->dispatch('adminhtml_block_eav_attribute_edit_form_init', ['form' => $this->getForm()]);

Classes raising the event

adminhtml_block_html_before

Origins

Classes raising the event

Use cases

To modify backend block contents.

adminhtml_block_promo_widget_chooser_prepare_collection

Use cases

To modify collection of shopping cart rules used in a chooser widget.

Origins

\Magento\SalesRule\Block\Adminhtml\Promo\Widget\Chooser::_prepareCollection():

protected function _prepareCollection()
{
...
$this->_eventManager->dispatch(
         'adminhtml_block_promo_widget_chooser_prepare_collection',
         ['collection' => $collection]
);

Classes raising the event

adminhtml_block_salesrule_actions_prepareform

Use cases

To modify sales rule actions form.

Origins

\Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Actions::addTabToForm():

protected function addTabToForm($model
                              , $fieldsetId = 'actions_fieldset'
                              , $formName = 'sales_rule_form')
{
...
$this->_eventManager->dispatch('adminhtml_block_salesrule_actions_prepareform'
      , ['form' => $form]);
);

Classes raising the event

adminhtml_cache_flush_all

Use cases

To perform actions before all cache is flushed.

Origins

Classes raising the event

adminhtml_cache_flush_system

Use cases

To perform actions when system cache is cleaned.

Origins

protected function performAction(array $cacheTypes)
{
$this->eventManager->dispatch('adminhtml_cache_flush_system');

Classes raising the the event

adminhtml_cache_refresh_type

Use cases

Origins

Classes raising the the event

adminhtml_catalog_category_tree_can_add_root_category

Use cases

To change availability of adding root category.

Origins

\Magento\Catalog\Block\Adminhtml\Category\Tree::canAddRootCategory():

public function canAddRootCategory()
{
  $options = new \Magento\Framework\DataObject(['is_allow' => true]);
  $this->_eventManager->dispatch(
      'adminhtml_catalog_category_tree_can_add_root_category',
      ['category' => $this->getCategory(), 'options' => $options, 'store' => $this->getStore()->getId()]
  );

Classes raising the event

adminhtml_catalog_category_tree_can_add_sub_category

Use cases

To change availability of adding a subcategory.

Origins

\Magento\Catalog\Block\Adminhtml\Category\Tree::canAddSubCategory():

public function canAddSubCategory()
{
      $options = new \Magento\Framework\DataObject(['is_allow' => true]);
      $this->_eventManager->dispatch(
         'adminhtml_catalog_category_tree_can_add_sub_category',
         ['category' => $this->getCategory(), 'options' => $options, 'store' => $this->getStore()->getId()]
      );

Classes raising the event

adminhtml_catalog_category_tree_is_moveable

Use cases

To change moveability of a category.

Origins

\Magento\Catalog\Block\Adminhtml\Category\Tree::_isCategoryMoveable():

protected function _isCategoryMoveable($node)
{
      $options = new \Magento\Framework\DataObject(['is_moveable' => true, 'category' => $node]);

      $this->_eventManager->dispatch('adminhtml_catalog_category_tree_is_moveable', ['options' => $options]);

Classes raising the event

adminhtml_catalog_product_attribute_edit_frontend_prepare_form

Use cases

To customize a product attribute edit form.

Origins

\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front::_prepareForm():

protected function _prepareForm()
{
...
$this->_eventManager->dispatch(
         'adminhtml_catalog_product_attribute_edit_frontend_prepare_form',
         ['form' => $form, 'attribute' => $attributeObject]
);

Classes raising the event

\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front

adminhtml_catalog_product_attribute_set_main_html_before

Use cases

To customize the adminhtml catalog attribute set main block.

Origins

\Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main::_toHtml():

   protected function _toHtml()
   {
      $this->_eventManager->dispatch(
         'adminhtml_catalog_product_attribute_set_main_html_before',
         ['block' => $this]
      );

Classes raising the event

adminhtml_catalog_product_attribute_set_toolbar_main_html_before

Use cases

To customize the adminhtml catalog attribute set toolbar main block.

Origins

\Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Main::_toHtml():

   protected function _toHtml()
   {
      $this->_eventManager->dispatch(
         'adminhtml_catalog_product_attribute_set_toolbar_main_html_before',
         ['block' => $this]
      );

Classes raising the event

adminhtml_catalog_product_edit_element_types

Use cases

To add or customize additional element types for catalog product edit attributes tab.

Origins

Classes raising the event

adminhtml_catalog_product_edit_prepare_form

Origins

There are only three classes that raise this event:

Use cases

To customize catalog product edit attribute tab form

adminhtml_catalog_product_edit_tab_attributes_create_html_before

Origins

Classes raising the event

Use cases

To customize catalog product edit create attribute block

adminhtml_catalog_product_form_prepare_excluded_field_list

Origins

Classes raising the event

Use cases

To customize catalog product edit attribute tab block

adminhtml_catalog_product_grid_prepare_massaction

Use cases

To customize Mass Actions of a catalog product grid backend block.

Origins

Classes raising the event

adminhtml_cmspage_on_delete

Origins

Classes raising the event

Use cases

To perform actions on either successful or unsuccessful cms page removal

adminhtml_controller_catalogrule_prepare_save

Origins

Classes raising the event

Use cases

To alter how a catalog price rule is being saved

adminhtml_controller_salesrule_prepare_save

Origins

Classes raising the event

Use cases

To alter how a cart price rule is being saved

adminhtml_customer_orders_add_action_renderer

Origins

Classes raising the event

Use cases

To modify the way action sales admin reorder block is rendered

adminhtml_customer_prepare_save

Use cases

To modify a customer object before it is saved in admin panel.

Origins

\Magento\Customer\Controller\Adminhtml\Index\Save::execute():

   public function execute()
   {
   ...
               $this->_eventManager->dispatch(
                  'adminhtml_customer_prepare_save',
                  ['customer' => $customer, 'request' => $this->getRequest()]
               );

Classes raising the event

adminhtml_customer_save_after

Use cases

To modify a customer object after it is saved in admin panel.

Origins

\Magento\Customer\Controller\Adminhtml\Index\Save::execute():

   public function execute()
   {
   ...
               $this->_eventManager->dispatch(
                  'adminhtml_customer_save_after',
                  ['customer' => $customer, 'request' => $this->getRequest()]
               );

Classes raising the event

adminhtml_product_attribute_types

Use cases

To modify the way product attributes are processed.

Origins

response is an object of \Magento\Framework\DataObject

Classes raising the event

adminhtml_promo_quote_edit_tab_coupons_form_prepare_form

Use cases

To modify the admin coupon code form is generated.

Origins

\Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Form::_prepareForm():

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

Classes raising the event

adminhtml_sales_order_create_process_data

Use cases

To modify an order after it gets processed.

Origins

\Magento\Sales\Controller\Adminhtml\Order\Create::_processActionData():

   protected function _processActionData()
   {
   ...
      $eventData = [
         'order_create_model' => $this->_getOrderCreateModel(),
         'request' => $this->getRequest()->getPostValue(),
      ];

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

Classes raising the event

adminhtml_sales_order_create_process_data_before

Use cases

To modify an order before it gets processed.

Origins

\Magento\Sales\Controller\Adminhtml\Order\Create::_processActionData():

   protected function _processActionData()
   {
      $eventData = [
         'order_create_model' => $this->_getOrderCreateModel(),
         'request_model' => $this->getRequest(),
         'session' => $this->_getSession(),
      ];

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

Classes raising the event

adminhtml_sales_order_create_process_item_after

Use cases

To modify an order item after it gets processed.

Origins

\Magento\Sales\Controller\Adminhtml\Order\Create::_processActionData():

   protected function _processActionData()
   {
      $eventData = [
         'order_create_model' => $this->_getOrderCreateModel(),
         'request_model' => $this->getRequest(),
         'session' => $this->_getSession(),
      ];
   ...
      $this->_eventManager->dispatch('adminhtml_sales_order_create_process_item_after', $eventData);

Classes raising the event

adminhtml_sales_order_create_process_item_before

Use cases

To modify an order item before it gets processed.

Origins

\Magento\Sales\Controller\Adminhtml\Order\Create::_processActionData():

   protected function _processActionData()
   {
      $eventData = [
         'order_create_model' => $this->_getOrderCreateModel(),
         'request_model' => $this->getRequest(),
         'session' => $this->_getSession(),
      ];
   ...
      $this->_eventManager->dispatch('adminhtml_sales_order_create_process_item_before', $eventData);

Classes raising the event

adminhtml_sales_order_creditmemo_register_before

Use cases

To modify a credit memo before it gets saved in the registry.

Origins

Classes raising the event

adminhtml_store_edit_form_prepare_form

Use cases

To a store edit form before it gets rendered.

Origins

\Magento\Backend\Block\System\Store\Edit\AbstractForm::_prepareForm():

   protected function _prepareForm()
   {
   ...
      $this->_eventManager->dispatch('adminhtml_store_edit_form_prepare_form', ['block' => $this]);

Classes raising the event

adminhtml_system_config_advanced_disableoutput_render_before

Use cases

To alter modules list before they get displayed.

Origins

\Magento\Config\Block\System\Config\Form\Fieldset\Modules\DisableOutput::render():

   protected function render()
   {
   ...
      $dispatchResult = new \Magento\Framework\DataObject($modules);
      $this->_eventManager->dispatch(
         'adminhtml_system_config_advanced_disableoutput_render_before',
         ['modules' => $dispatchResult]
      );

Classes raising the event

adminhtml_widget_grid_filter_collection

Use cases

To alter report collection or filter values.

Origins

\Magento\Reports\Block\Adminhtml\Grid::_prepareCollection():

   protected function _prepareCollection()
   {
   ...
         $this->_eventManager->dispatch(
               'adminhtml_widget_grid_filter_collection',
               ['collection' => $this->getCollection(), 'filter_values' => $this->_filterValues]
         );

Classes raising the event

admin_permissions_role_prepare_save

Use cases

To alter the role object before it is saved.

Origins

\Magento\User\Controller\Adminhtml\User\Role\SaveRole::execute():

   public function execute()
   {
   ...
         $this->_eventManager->dispatch(
               'admin_permissions_role_prepare_save',
               ['object' => $role, 'request' => $this->getRequest()]
         );

Classes raising the event

admin_system_config_changed_section_currency

Use cases

To perform actions after currency symbol is set in admin panel.

Origins

\Magento\CurrencySymbol\Model\System\Currencysymbol::setCurrencySymbolsData():

   public function setCurrencySymbolsData($symbols = [])
   {
   ...
      $this->_eventManager->dispatch(
         'admin_system_config_changed_section_currency',
         ['website' => $this->_websiteId, 'store' => $this->_storeId]
      );

Classes raising the event

admin_system_config_changed_section_currency_before_reinit

Use cases

To perform actions before admin configuration reinitialized.

Origins

\Magento\CurrencySymbol\Model\System\Currencysymbol::setCurrencySymbolsData():

   public function setCurrencySymbolsData($symbols = [])
   {
   ...
      $this->_eventManager->dispatch(
         'admin_system_config_changed_section_currency_before_reinit',
         ['website' => $this->_websiteId, 'store' => $this->_storeId]
      );

Classes raising the event

admin_system_config_changed_section_design

Use cases

To perform actions after admin design section saved or deleted.

Origins

Classes raising the event

admin_system_config_save

Use cases

To perform actions after admin configuration is saved.

Origins

\Magento\Config\Controller\Adminhtml\System\Config\Save::execute():

   public function execute()
   {
   ...
         $this->_eventManager->dispatch(
               'admin_system_config_save',
               ['configData' => $configData, 'request' => $this->getRequest()]
         );

Classes raising the event

admin_user_authenticate_after

Use cases

To perform actions after a user is authenticated.

Origins

Classes raising the event

admin_user_authenticate_before

Use cases

To perform actions before a user is authenticated.

Origins

\Magento\User\Model\User::authenticate():

   public function authenticate($username, $password)
   {
   ...
         $this->_eventManager->dispatch(
               'admin_user_authenticate_before',
               ['username' => $username, 'user' => $this]
         );

Classes raising the event

amazon_customer_authenticated

Use cases

To perform actions before an Amazon user is authenticated.

Origins

\Amazon\Login\Helper\Session::dispatchAuthenticationEvent():

   protected function dispatchAuthenticationEvent()
   {
      $this->eventManager->dispatch('amazon_customer_authenticated');
   }

Used in functions:

   public function loginById($customerId)
   {
      $this->dispatchAuthenticationEvent();
   ...

   public function login(CustomerInterface $customerData)
   {
      $this->dispatchAuthenticationEvent();
   ...

Classes raising the event

amazon_login_authorize_error

Use cases

To handle an Amazon login exception.

Origins

\Amazon\Login\Controller\Login\Authorize::execute():

   public function execute()
   {
   ..
      $this->_eventManager->dispatch('amazon_login_authorize_error', ['exception' => $e]);
   }

Classes raising the event

amazon_login_authorize_validation_error

Use cases

To handle a ValidatorException Amazon login exception.

Origins

\Amazon\Login\Controller\Login\Authorize::execute():

   public function execute()
   {
   ..
      $this->_eventManager->dispatch('amazon_login_authorize_validation_error', ['exception' => $e]);
   }

Classes raising the event

amazon_payment_authorize_before

Use cases

To perform actions before Amazon authorizes a payment.

Origins

\Amazon\Payment\Gateway\Request\AuthorizationRequestBuilder::build():

   public function build(array $buildSubject)
   {
   ..
         $transport = new DataObject($data);
         $this->eventManager->dispatch(
               'amazon_payment_authorize_before',
               [
                  'context' => 'authorization',
                  'payment' => $paymentDO->getPayment(),
                  'transport' => $transport
               ]
         );
   }

Classes raising the event

amazon_payment_pending_authorization_hard_decline_after

Use cases

To perform actions before a hard decline of Amazon payment.

Origins

\Amazon\Payment\Model\PaymentManagement\Authorization::hardDeclinePendingAuthorization():

   protected function hardDeclinePendingAuthorization(...)
   {
   ..
      $this->eventManager->dispatch(
         'amazon_payment_pending_authorization_hard_decline_after',
         [
               'order' => $order,
               'pendingAuthorization' => $pendingAuthorization,
         ]
      );
   }

Classes raising the event

amazon_payment_pending_authorization_soft_decline_after

Use cases

To perform actions before a soft Amazon payment decline.

Origins

\Amazon\Payment\Model\PaymentManagement\Authorization::softDeclinePendingAuthorization():

   protected function softDeclinePendingAuthorization(...)
   {
   ..
      $this->eventManager->dispatch(
         'amazon_payment_pending_authorization_soft_decline_after',
         [
               'order' => $order,
               'pendingAuthorization' => $pendingAuthorization,
         ]
      );
   }

Classes raising the event

assigned_theme_changed

Use cases

To perform actions after an assigned theme changed.

Origins

\Magento\Theme\Observer\CheckThemeIsAssignedObserver::execute():

   public function execute(EventObserver $observer)
   {
   ..
      $this->eventDispatcher->dispatch('assigned_theme_changed', ['theme' => $theme]);
   }

Classes raising the event

assign_theme_to_stores_after

Use cases

To perform actions after a new theme is assigned to a store.

Origins

\Magento\Theme\Model\Config::assignToStore():

   public function assignToStore(...)
   {
   ..
      $this->_eventManager->dispatch(
         'assign_theme_to_stores_after',
         ['stores' => $stores, 'scope' => $scope, 'theme' => $theme]
      );
   }

Classes raising the event

backend_auth_user_login_failed

Use cases

To perform actions after a backend login attempt has failed.

Origins

\Magento\Backend\Model\Auth::login():

   public function login($username, $password)
   {
   ..
      } catch (PluginAuthenticationException $e) {
         $this->_eventManager->dispatch(
               'backend_auth_user_login_failed',
               ['user_name' => $username, 'exception' => $e]
         );
         throw $e;
      } catch (\Magento\Framework\Exception\LocalizedException $e) {
         $this->_eventManager->dispatch(
               'backend_auth_user_login_failed',
               ['user_name' => $username, 'exception' => $e]
         );
   }

Classes raising the event

backend_auth_user_login_success

Use cases

To perform actions after a successful backend login attempt.

Origins

\Magento\Backend\Model\Auth::login():

   public function login($username, $password)
   {
   ..
               $this->_eventManager->dispatch(
                  'backend_auth_user_login_success',
                  ['user' => $this->getCredentialStorage()]
               );
   }

Classes raising the event

backend_block_widget_grid_prepare_grid_before

Use cases

To perform actions before a backend grid is prepared.

Origins

\Magento\Backend\Block\Widget\Grid::_prepareGrid():

   protected function _prepareGrid()
   {
      $this->_eventManager->dispatch(
         'backend_block_widget_grid_prepare_grid_before',
         ['grid' => $this, 'collection' => $this->getCollection()]
      );
   }

Classes raising the event

braintree_googlepay_update_quote_after

Use cases

To perform actions after braintree updates a quote.

Origins

\PayPal\Braintree\Model\GooglePay\Helper\QuoteUpdater::updateQuote():

   private function updateQuote(Quote $quote, array $details)
   {
   ...
      $this->eventManager->dispatch('braintree_googlepay_update_quote_after', [
         'quote' => $quote,
         'googlepay_response' => $details
      ]);
   }

Classes raising the event

braintree_googlepay_update_quote_before

Use cases

To perform actions before braintree updates a quote.

Origins

Classes raising the event

braintree_paypal_update_quote_after

Use cases

To perform actions after Braintree updates a quote.

Origins

\PayPal\Braintree\Model\Paypal\Helper\QuoteUpdater::updateQuote():

   private function updateQuote(Quote $quote, array $details)
   {
   ...
      $this->eventManager->dispatch('braintree_paypal_update_quote_before', [
         'quote' => $quote,
         'paypal_response' => $details
      ]);
   }

Classes raising the event

braintree_paypal_update_quote_before

Use cases

To perform actions before Braintree updates a quote.

Origins

\PayPal\Braintree\Model\Paypal\Helper\QuoteUpdater::updateQuote():

   private function updateQuote(Quote $quote, array $details)
   {
      $this->eventManager->dispatch('braintree_paypal_update_quote_before', [
         'quote' => $quote,
         'paypal_response' => $details
      ]);
   }

Classes raising the event

catalogrule_dirty_notice

Use cases

To perform actions when some catalog rules have changed but changes have not been applied yet.

Origins

\Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog\Index::execute():

   public function execute()
   {
      $dirtyRules = $this->_objectManager->create(\Magento\CatalogRule\Model\Flag::class)->loadSelf();
      $this->_eventManager->dispatch(
         'catalogrule_dirty_notice',
         ['dirty_rules' => $dirtyRules, 'message' => $this->getDirtyRulesNoticeMessage()]
      );
   }

Classes raising the event

catalogsearch_reset_search_result

Use cases

To perform actions when search results are reset.

Origins

store_id is a store identifier.

Classes raising the event

catalogsearch_searchable_attributes_load_after

Use cases

To perform actions after searchable attributes get loaded.

Origins

\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider::getSearchableAttributes():

   public function getSearchableAttributes($backendType = null)
   {
   ...
         $this->eventManager->dispatch(
               'catalogsearch_searchable_attributes_load_after',
               ['engine' => $this->engine, 'attributes' => $attributes]
         );
   }

Classes raising the event

catalog_block_product_list_collection

Use cases

To perform actions with a product collection after it is initialized.

Origins

\Magento\Catalog\Block\Product\ListProduct::initializeProductCollection():

   private function initializeProductCollection()
   {
   ...
      $this->_eventManager->dispatch(
         'catalog_block_product_list_collection',
         ['collection' => $collection]
      );
   }

Classes raising the event

catalog_block_product_status_display

Use cases

To perform actions when the displayProductStockStatus() function is called.

Origins

\Magento\Catalog\Block\Product\AbstractProduct::displayProductStockStatus():

   public function displayProductStockStatus()
   {
      $statusInfo = new \Magento\Framework\DataObject(['display_status' => true]);
      $this->_eventManager->dispatch('catalog_block_product_status_display'
                                    , ['status' => $statusInfo]);
      return (bool) $statusInfo->getDisplayStatus();
   }

Classes raising the event

catalog_category_change_products

Use cases

To perform actions after new products get assigned to a category. Assigned products get unassigned, or positions of assigned products are changed.

Origins

\Magento\Catalog\Model\ResourceModel\Category::_saveCategoryProducts():

   protected function _saveCategoryProducts($category)
   {
   ...
         $this->_eventManager->dispatch(
               'catalog_category_change_products',
               ['category' => $category, 'product_ids' => $productIds]
         );
   }

Classes raising the event

catalog_category_delete_after_done

Use cases

To perform actions after a category gets deleted.

Origins

Classes raising the event

catalog_category_flat_loadnodes_before

Use cases

To modify a select object before category flat nodes are loaded.

Origins

\Magento\Catalog\Model\ResourceModel\Category\Flat::_loadNodes():

   protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId = 0, $skipMenuFilter = false)
   {
   ...
      $this->_eventManager->dispatch('catalog_category_flat_loadnodes_before'
                                    , ['select' => $select]);

Classes raising the event

catalog_category_prepare_save

Use cases

To modify a category before it is saved.

Origins

\Magento\Catalog\Controller\Adminhtml\Category\Save::execute():

   public function execute()
   {
   ...
               $this->_eventManager->dispatch(
                  'catalog_category_prepare_save',
                  ['category' => $category, 'request' => $this->getRequest()]
               );

Classes raising the event

catalog_category_tree_init_inactive_category_ids

Use cases

To add more inactive category IDs.

Origins

tree is an object of \Magento\Catalog\Model\ResourceModel\Category\Tree or \Magento\Catalog\Model\ResourceModel\Category\Flat

Classes that raise the event

catalog_controller_category_delete

Use cases

To perform actions before a category gets deleted.

Origins

\Magento\Catalog\Controller\Adminhtml\Category\Delete::execute():

   public function execute()
   {
   ...
               $this->_eventManager->dispatch('catalog_controller_category_delete', ['category' => $category]);

Classes raising the event

catalog_controller_category_init_after

Use cases

To perform actions after a category gets initialized.

Origins

\Magento\Catalog\Controller\Category\View::_initCategory():

   protected function _initCategory()
   {
   ...
         $this->_eventManager->dispatch(
               'catalog_controller_category_init_after',
               ['category' => $category, 'controller_action' => $this]
         );

Classes raising the event

catalog_controller_product_init_after

Use cases

To perform actions after a product gets initialized.

Origins

\Magento\Catalog\Helper\Product::initProduct():

   public function initProduct($productId, $controller, $params = null)
   {
   ...
         $this->_eventManager->dispatch(
               'catalog_controller_product_init_after',
               ['product' => $product, 'controller_action' => $controller]
         );

Classes raising the event

catalog_controller_product_init_before

Use cases

To perform actions before a product gets initialized.

Origins

\Magento\Catalog\Helper\Product::initProduct():

   public function initProduct($productId, $controller, $params = null)
   {
   ...
      $this->_eventManager->dispatch(
         'catalog_controller_product_init_before',
         ['controller_action' => $controller, 'params' => $params]
      );

Classes raising the event

catalog_controller_product_view

Use cases

To perform actions before a product page is displayed on the frontend.

Origins

\Magento\Catalog\Helper\Product\View::prepareAndRender():

   public function initProduct($productId, $controller, $params = null)
   {
   ...
      $this->_eventManager->dispatch('catalog_controller_product_view', ['product' => $product]);

Classes raising the event

catalog_prepare_price_select

Use cases

To modify the way prices are added to a select statement.

Origins

\Magento\Catalog\Model\ResourceModel\Product\Collection::_preparePriceExpressionParameters():

   protected function _preparePriceExpressionParameters($select)
   {
   ...
      $eventArgs = [
         'select' => $select,
         'table' => $table,
         'store_id' => $this->getStoreId(),
         'response_object' => $response,
      ];

      $this->_eventManager->dispatch('catalog_prepare_price_select', $eventArgs);

Classes raising the event

catalog_product_attribute_update_before

Use cases

To perform actions before a product attribute(s) gets updated.

Origins

\Magento\Catalog\Model\Product\Action::updateAttributes():

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

Classes raising the event

catalog_product_collection_apply_limitations_after

Use cases

To perform actions after product collection limitations have been applied.

Origins

\Magento\Catalog\Model\ResourceModel\Product\Collection::_applyProductLimitations():

   protected function _applyProductLimitations()
   {
   ...
      $this->_eventManager->dispatch(
         'catalog_product_collection_apply_limitations_after',
         ['collection' => $this]
      );

Classes raising the event

catalog_product_collection_before_add_count_to_categories

Use cases

To perform actions before category counts get added to a product collection.

Origins

Classes raising the event

catalog_product_collection_load_after

Use cases

To perform actions after a product collection gets loaded.

Origins

\Magento\Catalog\Model\ResourceModel\Product\Collection::_afterLoad():

   protected function _afterLoad()
   {
   ...
   $this->_eventManager->dispatch('catalog_product_collection_load_after', ['collection' => $this]);

Classes raising the event

catalog_product_compare_add_product

Use cases

To perform actions after a product gets added to a compare list.

Origins

\Magento\Catalog\Controller\Product\Compare\Add::execute():

   public function execute()
   {
   ...
   $this->_eventManager->dispatch('catalog_product_compare_add_product', ['product' => $product]);

Classes raising the event

catalog_product_compare_item_collection_clear

Use cases

To perform actions after a compare list collection gets cleared.

Origins

\Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection::clear():

   public function clear()
   {
      $this->_catalogProductCompareItem->clearItems($this->getVisitorId(), $this->getCustomerId());
      $this->_eventManager->dispatch('catalog_product_compare_item_collection_clear');
   ...

Classes raising the event

catalog_product_compare_remove_product

Use cases

To perform actions after a product gets removed from a compare list.

Origins

\Magento\Catalog\Controller\Product\Compare\Remove::execute(): d

   public function execute()
   {
   ...
                  $this->_eventManager->dispatch(
                     'catalog_product_compare_remove_product',
                     ['product' => $item]
                  );
   ...

Classes raising the event

catalog_product_delete_after_done

Use cases

To perform actions after a product gets deleted.

Origins

\Magento\Catalog\Model\ResourceModel\Product::delete():

   public function delete($object)
   {
      $this->getEntityManager()->delete($object);
      $this->eventManager->dispatch(
         'catalog_product_delete_after_done',
         ['product' => $object]
      );
   ...

Classes raising the event

catalog_product_edit_action

Use cases

To perform actions after a product gets edited in admin panel.

Origins

\Magento\Catalog\Controller\Adminhtml\Product\Edit::execute():

   public function execute()
   {
   ...
      $this->_eventManager->dispatch('catalog_product_edit_action', ['product' => $product]);

Classes raising the event

Use cases

To modify the way a product admin gallery block layout is rendered.

Origins

\Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content::_prepareLayout():

   protected function _prepareLayout()
   {
   ...
      $this->_eventManager->dispatch('catalog_product_gallery_prepare_layout', ['block' => $this]);

Classes raising the event

Use cases

To perform an action after product gallery image gets uploaded.

Origins

\Magento\Catalog\Controller\Adminhtml\Product\Gallery\Upload::execute():

   public function execute()
   {
   ...
         $this->_eventManager->dispatch(
               'catalog_product_gallery_upload_image_after',
               ['result' => $result, 'action' => $this]
         );

Classes raising the event

catalog_product_get_final_price

Use cases

To alter the way the final product price is generated.

Origins

   public function getSelectionFinalTotalPrice(
      $bundleProduct,
      $selectionProduct,
      $bundleQty,
      $selectionQty,
      $multiplyQty = true,
      $takeTierPrice = true
  ) {
  ...
               $this->_eventManager->dispatch(
                  'catalog_product_get_final_price',
                  ['product' => $product, 'qty' => $bundleQty]
              );

Classes raising the event

catalog_product_import_bunch_delete_after

Use cases

To perform an action after products get deleted.

Origins

\Magento\CatalogImportExport\Model\Import\Product::_deleteProducts():

   protected function _deleteProducts()
   {
   ...
               $this->_eventManager->dispatch(
                  'catalog_product_import_bunch_delete_after',
                  ['adapter' => $this, 'bunch' => $bunch]
               );

Classes raising the event

catalog_product_import_bunch_delete_commit_before

Use cases

To perform an action before products get deleted.

Origins

\Magento\CatalogImportExport\Model\Import\Product::_deleteProducts():

   protected function _deleteProducts()
   {
   ...
                  $this->_eventManager->dispatch(
                     'catalog_product_import_bunch_delete_commit_before',
                     [
                           'adapter' => $this,
                           'bunch' => $bunch,
                           'ids_to_delete' => $idsToDelete,
                     ]
                  );

Classes raising the event

catalog_product_import_bunch_save_after

Use cases

To perform an action after products get saved.

Origins

\Magento\CatalogImportExport\Model\Import\Product::_saveProducts():

   protected function _deleteProducts()
   {
   ...
         $this->_eventManager->dispatch(
               'catalog_product_import_bunch_save_after',
               ['adapter' => $this, 'bunch' => $bunch]
         );

Classes raising the event

catalog_product_import_finish_before

Use cases

To perform an action before a product import is finished.

Origins

\Magento\CatalogImportExport\Model\Import\Product::_importData():

   protected function _importData()
   {
   ...
      $this->_eventManager->dispatch('catalog_product_import_finish_before', ['adapter' => $this]);

Classes raising the event

catalog_product_is_salable_after

Use cases

To perform an action after it checks if a product is available for sale.

Origins

\Magento\Catalog\Model\Product::isSalable():

   public function isSalable()
   {
   ...
      $object = new \Magento\Framework\DataObject(['product' => $this, 'is_salable' => $salable]);
      $this->_eventManager->dispatch(
         'catalog_product_is_salable_after',
         ['product' => $this, 'salable' => $object]
      );

Classes raising the event

catalog_product_is_salable_before

Use cases

To perform an action before it checks if a product is available for sale.

Origins

\Magento\Catalog\Model\Product::isSalable():

   public function isSalable()
   {
   ...
      $this->_eventManager->dispatch('catalog_product_is_salable_before', ['product' => $this]);

Classes raising the event

catalog_product_new_action

Use cases

To perform an action after a new product is created.

Origins

\Magento\Catalog\Controller\Adminhtml\Product\NewAction::execute():

   public function execute()
   {
   ...
      $this->_eventManager->dispatch('catalog_product_new_action', ['product' => $product]);

Classes raising the event

catalog_product_option_price_configuration_after

Use cases

To modify JSON representation of product price options.

Origins

\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle::getJsonConfig() and \Magento\Catalog\Block\Product\View\Options::getJsonConfig():

   public function getJsonConfig()
   {
   ...
      $configObj = new DataObject(
         [
               'config' => $config,
         ]
      );
      $this->_eventManager->dispatch('catalog_product_option_price_configuration_after', ['configObj' => $configObj]);

Classes raising the event

catalog_product_prepare_index_select

Use cases

To alter temporary price index data for bundle products.

Origins

\Magento\Bundle\Model\ResourceModel\Indexer\Price::prepareBundlePriceByType():

   private function prepareBundlePriceByType($priceType, array $dimensions, $entityIds = null)
   {
   ...
      $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('pw.website_id'),
               'store_field' => new \Zend_Db_Expr('cwd.default_store_id')
         ]
      );

Classes raising the event

catalog_product_to_website_change

Use cases

To perform actions after product websites have been updated.

Origins

\Magento\Catalog\Model\Product\Action::updateWebsites():

   public function updateWebsites($productIds, $websiteIds, $type)
   {
   ...
      $this->_eventManager->dispatch('catalog_product_to_website_change', ['products' => $productIds]);

Classes raising the event

catalog_product_upsell

Use cases

To do modify a product's upsell collection.

Origins

\Magento\Catalog\Block\Product\ProductList\Upsell::_prepareData():

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

Classes raising the event

catalog_product_validate_variations_before

Use cases

To perform actions before a product variations attributes validation.

Origins

\Magento\ConfigurableProduct\Model\Product\Validator\Plugin::_validateProductVariations():

   protected function _validateProductVariations(Product $parentProduct, array $products, RequestInterface $request)
   {
   ...
      $this->eventManager->dispatch(
         'catalog_product_validate_variations_before',
         ['product' => $parentProduct, 'variations' => $products]
      );

Classes raising the event

catalog_product_view_config

Use cases

To perform actions a JSON encoded product configuration.

Origins

\Magento\Catalog\Block\Product\View::getJsonConfig():

   public function getJsonConfig()
   {
   ...
   $responseObject = new \Magento\Framework\DataObject();
   $this->_eventManager->dispatch('catalog_product_view_config', ['response_object' => $responseObject]);

Classes raising the event

category_move

Use cases

To perform actions after a category has been moved.

Origins

\Magento\Catalog\Model\Category::move():

   public function move($parentId, $afterCategoryId)
   {
   ...
   $this->_eventManager->dispatch('category_move', $eventParams);

Classes raising the event

category_prepare_ajax_response

Use cases

To modify category ajax response object.

Origins

\Magento\Catalog\Controller\Adminhtml\Category::ajaxRequestResponse():

   protected function ajaxRequestResponse($category, $resultPage)
   {
   ...
      $this->_eventManager->dispatch(
         'category_prepare_ajax_response',
         ['response' => $eventResponse, 'controller' => $this]
      );

Classes raising the event

catelogsearch_searchable_attributes_load_after

Use cases

To modify a searchable attributes array.

Origins

\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider::getSearchableAttributes():

   public function getSearchableAttributes($backendType = null)
   {
   ...
      $this->eventManager->dispatch(
               'catelogsearch_searchable_attributes_load_after',
               ['engine' => $this->engine, 'attributes' => $attributes]
      );

Classes raising the event

checkout_allow_guest

Use cases

To modify the allow guest checkout check (or do something if it is enabled).

Origins

\Magento\Checkout\Helper\Data::isAllowedGuestCheckout():

   public function isAllowedGuestCheckout(\Magento\Quote\Model\Quote $quote, $store = null)
   {
   ...
      $this->_eventManager->dispatch(
               'checkout_allow_guest',
               ['quote' => $quote, 'store' => $store, 'result' => $result]
      );

Classes raising the event

checkout_cart_add_product_complete

Use cases

To perform actions after a product has been added to the cart.

Origins

\Magento\Checkout\Controller\Cart\Add::execute():

   public function execute()
   {
   ...
         $this->_eventManager->dispatch(
               'checkout_cart_add_product_complete',
               ['product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse()]
         );

Classes raising the event

checkout_cart_product_add_before

Use cases

To perform actions before a product has been added to the cart.

Origins

\Magento\Checkout\Model\Cart::addProduct():

   public function addProduct($productInfo, $requestInfo = null)
   {
   ...
               $this->_eventManager->dispatch(
                  'checkout_cart_product_add_before',
                  ['info' => $requestInfo, 'product' => $product]
               );

Classes raising the event

checkout_cart_product_update_after

Use cases

To perform actions after a cart item has been updated.

Origins

\Magento\Checkout\Model\Cart::updateItem():

   public function updateItem($itemId, $requestInfo = null, $updatingParams = null)
   {
   ...
      $this->_eventManager->dispatch(
         'checkout_cart_product_update_after',
         ['quote_item' => $result, 'product' => $product]
      );

Classes raising the event

checkout_cart_save_after

Use cases

To perform actions after a cart has been saved.

Origins

\Magento\Checkout\Model\Cart::save():

   public function save()
   {
   ...
      $this->_eventManager->dispatch('checkout_cart_save_after', ['cart' => $this]);

Classes raising the event

checkout_cart_save_before

Use cases

To perform actions before a cart is updated.

Origins

\Magento\Checkout\Model\Cart::save():

   public function save()
   {
   ...
      $this->_eventManager->dispatch('checkout_cart_save_before', ['cart' => $this]);

Classes raising the event

checkout_cart_update_items_after

Use cases

To perform actions after cart items have been updated.

Origins

\Magento\Checkout\Model\Cart::updateItems():

   public function updateItems($data)
   {
   ...
      $this->_eventManager->dispatch(
         'checkout_cart_update_items_after',
         ['cart' => $this, 'info' => $infoDataObject]
      );

Classes raising the event

checkout_cart_update_items_before

Use cases

To perform actions before cart items are updated.

Origins

\Magento\Checkout\Model\Cart::updateItems():

   public function updateItems($data)
   {
   ...
      $this->_eventManager->dispatch(
         'checkout_cart_update_items_before',
         ['cart' => $this, 'info' => $infoDataObject]
      );

Classes raising the event

checkout_cart_update_item_complete

Use cases

To perform actions once a cart item update is complete.

Origins

\Magento\Checkout\Controller\Cart\UpdateItemOptions::execute():

   public function execute()
   {
   ...
   $this->_eventManager->dispatch(
               'checkout_cart_update_item_complete',
               ['item' => $item, 'request' => $this->getRequest(), 'response' => $this->getResponse()]
   );

Classes raising the event

checkout_controller_multishipping_shipping_post

Use cases

To perform actions before a multishipping shipping method is set.

Origins

\Magento\Multishipping\Controller\Checkout\ShippingPost::execute():

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

Classes raising the event

checkout_controller_onepage_saveOrder

Use cases

To perform actions after an attempt to place an order has been made (successful or not).

Origins

\Magento\Checkout\Controller\Onepage\SaveOrder::execute():

   public function execute()
   {
   ...
      $this->_eventManager->dispatch(
         'checkout_controller_onepage_saveOrder',
         [
               'result' => $result,
               'action' => $this
         ]
      );

Classes raising the event

checkout_multishipping_refund_all

Use cases

To do catch a moment when multishipping orders failed to be placed.

Origins

\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders():

   public function execute()
   {
   ...
      } catch (\Exception $e) {
         $this->_eventManager->dispatch('checkout_multishipping_refund_all', ['orders' => $orders]);
         throw $e;
      }

Classes raising the event

checkout_onepage_controller_success_action

Use cases

To perform actions when an one page checkout success page is rendered.

Origins

\Magento\Checkout\Controller\Onepage\Success::execute():

   public function execute()
   {
   ...
      $this->_eventManager->dispatch(
         'checkout_onepage_controller_success_action',
         [
               'order_ids' => [$session->getLastOrderId()],
               'order' => $session->getLastRealOrder()
         ]
      );

Classes raising the event

checkout_quote_destroy

Use cases

To perform actions when a session quote is cleared.

Origins

\Magento\Checkout\Model\Session::clearQuote():

   public function clearQuote()
   {
   ...
      $this->_eventManager->dispatch('checkout_quote_destroy', ['quote' => $this->getQuote()]);

Classes raising the event

checkout_quote_init

Use cases

To perform actions when a session quote is initialized.

Origins

\Magento\Checkout\Model\Session::getQuote():

   public function getQuote()
   {
   ...
   $this->_eventManager->dispatch('checkout_quote_init', ['quote' => $quote]);

Classes raising the event

checkout_submit_all_after

Use cases

To perform actions after an order was placed.

Origins

Classes raising the event

checkout_submit_before

Use cases

To perform actions when before a quote is submitted.

Origins

\Magento\Quote\Model\QuoteManagement::placeOrder():

   public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
   {
   ...
   $this->eventManager->dispatch('checkout_submit_before', ['quote' => $quote]);

Classes raising the event

checkout_type_multishipping_create_orders_single

Use cases

To perform actions after a single order is placed within a multishipping checkout.

Origins

\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders():

   public function createOrders()
   {
   ...
               $this->_eventManager->dispatch(
                  'checkout_type_multishipping_create_orders_single',
                  ['order' => $order, 'address' => $address, 'quote' => $this->getQuote()]
               );

Classes raising the event

checkout_type_multishipping_set_shipping_items

Use cases

To perform actions after shipping information is set within a multishipping checkout.

Origins

\Magento\Multishipping\Model\Checkout\Type\Multishipping::setShippingItemsInformation():

   public function setShippingItemsInformation($info)
   {
   ...
         $this->_eventManager->dispatch('checkout_type_multishipping_set_shipping_items', ['quote' => $quote]);

Classes raising the event

checkout_type_onepage_save_order_after

Use cases

To perform actions after an order is saved within a onepage checkout.

Origins

\Magento\Checkout\Model\Type\Onepage::saveOrder():

   public function saveOrder()
   {
   ...
         $this->_eventManager->dispatch(
               'checkout_type_onepage_save_order_after',
               ['order' => $order, 'quote' => $this->getQuote()]
         );

Classes raising the event

clean_cache_after_reindex

Use cases

To perform actions before indexed item cache entries are cleared.

Origins

\Magento\Indexer\Model\Processor\CleanCache::afterUpdateMview():

   public function afterUpdateMview(\Magento\Indexer\Model\Processor $subject)
   {
      $this->eventManager->dispatch('clean_cache_after_reindex', ['object' => $this->context]);
   ...

Classes raising the event

clean_cache_by_tags

Use cases

To perform actions at the time specific tags are cleaned from cache.

Origins

object is an object of \Magento\Framework\Indexer\CacheContext.

Classes raising the event

clean_catalog_images_cache_after

Use cases

To perform actions after image cache has been cleared.

Origins

\Magento\Backend\Controller\Adminhtml\Cache\CleanImages::execute():

   public function execute()
   {
   ....
   $this->_eventManager->dispatch('clean_catalog_images_cache_after');

Classes raising the event

clean_media_cache_after

Use cases

To perform actions after JavaScript/CSS cache has been cleared.

Origins

\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia::execute():

   public function execute()
   {
   ....
   $this->_eventManager->dispatch('clean_media_cache_after');

Classes raising the event

clean_static_files_cache_after

Use cases

To perform actions after static files cache has been cleared.

Origins

\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles::execute():

   public function execute()
   {
   ....
   $this->_eventManager->dispatch('clean_static_files_cache_after');

Classes raising the event

cms_controller_router_match_before

Use cases

To perform actions before a CMS page is matched.

Origins

\Magento\Cms\Controller\Router::match():

   public function match(\Magento\Framework\App\RequestInterface $request)
   {
   ....
   $this->_eventManager->dispatch(
         'cms_controller_router_match_before',
         ['router' => $this, 'condition' => $condition]
   );

Classes raising the event

cms_page_prepare_save

Use cases

To perform actions before a cms page is saved.

Origins

\Magento\Cms\Controller\Adminhtml\Page\Save::execute():

   public function execute()
   {
   ....
   $this->_eventManager->dispatch(
                  'cms_page_prepare_save',
                  ['page' => $model, 'request' => $this->getRequest()]
   );

Classes raising the event

cms_page_render

Use cases

To perform actions before a cms page is rendered.

Origins

\Magento\Cms\Helper\Page::prepareResultPage():

   public function prepareResultPage(ActionInterface $action, $pageId = null)
   {
   ....
      $this->_eventManager->dispatch(
         'cms_page_render',
         ['page' => $this->_page, 'controller_action' => $action, 'request' => $this->_getRequest()]
      );

Classes raising the event

cms_wysiwyg_images_static_urls_allowed

Use cases

To do change whether using static URLs is allowed or not.

Origins

Classes raising the event

controller_action_catalog_product_save_entity_after

Use cases

To perform actions after a product has been saved in backend.

Origins

Classes raising the event

controller_action_inventory_populate_source_with_data

Use cases

Modify inventory source before it gets saved.

Origins

\Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save::processSave():

private function processSave(SourceInterface $source, array $requestData)
{
....
      $this->_eventManager->dispatch(
         'controller_action_inventory_populate_source_with_data',
         [
               'request' => $this->getRequest(),
               'source' => $source,
         ]
      );

Classes raising the event

controller_action_inventory_populate_stock_with_data

Use cases

Modify inventory stock model before it gets saved.

Origins

\Magento\InventoryAdminUi\Model\Stock\StockSaveProcessor::process():

public function process($stockId, RequestInterface $request): int
{
....
      $this->eventManager->dispatch(
         'controller_action_inventory_populate_stock_with_data',
         [
               'request' => $request,
               'stock' => $stock,
         ]
      );

Classes raising the event

controller_action_inventory_source_save_after

Use cases

Modify inventory source after it gets saved.

Origins

\Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save::processSave():

private function processSave(SourceInterface $source, array $requestData)
{
....
      $this->_eventManager->dispatch(
         'controller_action_inventory_source_save_after',
         [
               'request' => $this->getRequest(),
               'source' => $source,
         ]
      );

Classes raising the event

controller_action_layout_render_before

Use cases

To perform actions before page layout is rendered.

Origins

\Magento\Framework\App\View::renderLayout():

public function renderLayout($output = '')
{
....
$this->_eventManager->dispatch('controller_action_layout_render_before');

Classes raising the event

controller_action_nocookies

Use cases

To perform actions before a nocookies page is rendered.

Origins

\Magento\Cookie\Controller\Index\NoCookies::execute():

public function execute()
{
....
$this->_eventManager->dispatch(
         'controller_action_nocookies',
         ['action' => $this, 'redirect' => $redirect]
);

Classes raising the event

controller_action_noroute

Use cases

To perform actions before a 404 page is rendered.

Origins

\Magento\Framework\Controller\Noroute\Index::execute():

public function execute()
{
....
$this->_eventManager->dispatch('controller_action_noroute',
      ['action' => $this, 'status' => $status]);

Classes raising the event

controller_action_postdispatch

Use cases

To perform actions when postdispatch events are raised.

Origins

\Magento\Framework\App\Action\Plugin\EventDispatchPlugin::dispatchPostDispatchEvents():

private function dispatchPostDispatchEvents(ActionInterface $action)
{
....
$this->eventManager->dispatch('controller_action_postdispatch', $this->getEventParameters($action));

Classes raising the event

controller_action_predispatch

Use cases

To perform actions when predispatch events are raised.

Origins

\Magento\Framework\App\Action\Plugin\EventDispatchPlugin::dispatchPreDispatchEvents():

private function dispatchPreDispatchEvents(ActionInterface $action)
{
$this->eventManager->dispatch('controller_action_predispatch', $this->getEventParameters($action));
...

Classes raising the event

controller_front_send_response_before

Use cases

To perform actions before sending application output.

Origins

\Magento\Framework\App\Http::launch():

public function launch()
{
...
$eventParams = ['request' => $this->_request, 'response' => $this->_response];
$this->_eventManager->dispatch('controller_front_send_response_before', $eventParams);
...

Classes raising the event

core_app_init_current_store_after

Use cases

To perform actions after the current store is initialized in test cases.

Origins

\Magento\TestFramework\Store\StoreManager::dispatchInitCurrentStoreAfterEvent():

protected function dispatchInitCurrentStoreAfterEvent()
{
...
$this->eventManager->dispatch('core_app_init_current_store_after');

Classes raising the event

core_collection_abstract_load_after

Use cases

To perform actions after a collection is loaded.

Origins

\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection::_afterLoad():

protected function _afterLoad()
{
...
$this->_eventManager->dispatch('core_collection_abstract_load_after', ['collection' => $this]);

collection is an object of \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection

Classes raising the event

core_collection_abstract_load_before

Use cases

To perform actions before a collection is loaded.

Origins

\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection::_beforeLoad():

protected function _beforeLoad()
{
...
$this->_eventManager->dispatch('core_collection_abstract_load_before', ['collection' => $this]);

collection is an object of \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection

Classes raising the event

core_layout_block_create_after

Use cases

To perform actions after a particular block is created.

Origins

\Magento\Framework\View\Layout\Generator\Block::process():

public function process(Layout\Reader\Context $readerContext, Layout\Generator\Context $generatorContext)
{
...
$this->eventManager->dispatch('core_layout_block_create_after', ['block' => $block]);

block is an object of \Magento\Framework\View\Element\AbstractBlock

Classes raising the event

core_layout_render_element

Use cases

To perform actions when a layout element is rendered.

Origins

\Magento\Framework\View\Layout::renderElement():

public function renderElement($name, $useCache = true)
{
...
$this->_eventManager->dispatch(
         'core_layout_render_element',
         ['element_name' => $name, 'layout' => $this, 'transport' => $this->_renderingOutput]
      );

Classes raising the event

cron_job_run

Use cases

To perform actions before a particular cron job is run.

Origins

\Magento\Cron\Observer\ProcessCronQueueObserver::_runJob():

protected function _runJob($scheduledTime, $currentTime, $jobConfig, $schedule, $groupId)
{
...
$this->eventManager->dispatch('cron_job_run', ['job_name' => 'cron/' . $groupId . '/' . $jobCode]);

job_name is a job name string.

Classes raising the event

currency_display_options_forming

Use cases

To perform actions after getting getting a currency object by currency code.

Origins

\Magento\Framework\Locale\Currency::getCurrency():

public function getCurrency($currency)
{
...
$this->_eventManager->dispatch(
               'currency_display_options_forming',
               ['currency_options' => $options, 'base_code' => $currency]
);

Classes raising the event

customer_account_edited

Use cases

To perform actions after a customer has been successfully edited.

Origins

\Magento\Customer\Controller\Account\EditPost::dispatchSuccessEvent():

private function dispatchSuccessEvent(\Magento\Customer\Api\Data\CustomerInterface $customerCandidateDataObject)
{
      $this->_eventManager->dispatch(
         'customer_account_edited',
         ['email' => $customerCandidateDataObject->getEmail()]
      );
}

Classes raising the event

customer_address_format

Use cases

To alter the way an address is formatted.

Origins

Classes raising the event

customer_customer_authenticated

Use cases

To perform actions after a customer has been authenticated.

Origins

Classes raising the event

customer_data_object_login

Use cases

To perform actions after a customer has been logged in.

Origins

Classes raising the event

customer_login

Use cases

To perform actions after a customer has been logged in.

Origins

public function createCustomerAccessToken($username, $password)
{
...
$this->eventManager->dispatch('customer_login', ['customer' => $customerDataObject]);

Classes raising the event

customer_logout

Use cases

To perform actions before a customer is logged out.

Origins

\Magento\Customer\Model\Session::logout():

public function logout()
{
....
$this->_eventManager->dispatch('customer_logout', ['customer' => $this->getCustomer()]);
}

customer is an object of \Magento\Customer\Model\Customer

Classes raising the event