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]);
collectionis an object of\Magento\Framework\Data\AbstractSearchResult
Examples of classes that raise the event
\Magento\CatalogInventory\Model\ResourceModel\Stock\Collection\Magento\CatalogInventory\Model\ResourceModel\Stock\Item\Collection\Magento\CatalogInventory\Model\ResourceModel\Stock\Status\Collection
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]);
collectionis an object of\Magento\Framework\Data\AbstractSearchResult
Classes raising the event
\Magento\CatalogInventory\Model\ResourceModel\Stock\Collection\Magento\CatalogInventory\Model\ResourceModel\Stock\Item\Collection\Magento\CatalogInventory\Model\ResourceModel\Stock\Status\Collection
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()]);
formis an object of\Magento\Framework\Data\Form
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Main
adminhtml_block_html_before
Origins
-
\Magento\Backend\Block\Template::_toHtml():protected function _toHtml() { $this->_eventManager->dispatch('adminhtml_block_html_before', ['block' => $this]); -
\Magento\Customer\\Block\Adminhtml\Edit\Tab\Carts::_toHtml():protected function _toHtml() { $this->_eventManager->dispatch('adminhtml_block_html_before', ['block' => $this]); -
blockis an object of\Magento\Framework\View\Element\Template
Classes raising the event
\Magento\AdminNotification\Block\System\Messages\Magento\AdobeIms\Block\Adminhtml\SignIn
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]
);
collectionis an object of\Magento\SalesRule\Model\ResourceModel\Rule\Collection
Classes raising the event
\Magento\SalesRule\Block\Adminhtml\Promo\Widget\Chooser
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]);
);
formis an object of\Magento\Framework\Data\Form
Classes raising the event
\Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Actions
adminhtml_cache_flush_all
Use cases
To perform actions before all cache is flushed.
Origins
-
\Magento\Backend\Controller\Adminhtml\Cache\FlushAll::execute():public function execute() { $this->_eventManager->dispatch('adminhtml_cache_flush_all'); -
\Magento\Backend\Console\Command\CacheFlushCommand::performAction():protected function performAction(array $cacheTypes) { $this->eventManager->dispatch('adminhtml_cache_flush_all');
Classes raising the event
\Magento\Backend\Controller\Adminhtml\Cache\FlushAll\Magento\Backend\Console\Command\CacheFlushCommand
adminhtml_cache_flush_system
Use cases
To perform actions when system cache is cleaned.
Origins
-
\Magento\Translation\Model\Inline\CacheManager::updateAndGetTranslations():public function updateAndGetTranslations() { $this->eventManager->dispatch('adminhtml_cache_flush_system'); -
\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem::execute():public function execute() { ... $this->_eventManager->dispatch('adminhtml_cache_flush_system'); -
\Magento\Backend\Console\Command\CacheCleanCommand::performAction()
protected function performAction(array $cacheTypes)
{
$this->eventManager->dispatch('adminhtml_cache_flush_system');
Classes raising the the event
\Magento\Translation\Model\Inline\CacheManager\Magento\Backend\Controller\Adminhtml\Cache\FlushSystem\Magento\Backend\Console\Command\CacheCleanCommand
adminhtml_cache_refresh_type
Use cases
- To perform actions before Full Page Cache is cleared.
- To perform actions after Configuration Cache is cleared.
Origins
-
\Magento\Tax\Controller\Adminhtml\Tax\IgnoreTaxNotification::execute():public function execute() { $this->_eventManager->dispatch('adminhtml_cache_refresh_type', ['type' => 'config']);typefor cache type cleared
-
\Magento\PageCache\Model\Cache\Type::clean():public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = []) { $this->eventManager->dispatch('adminhtml_cache_refresh_type');
Classes raising the the event
\Magento\Tax\Controller\Adminhtml\Tax\IgnoreTaxNotification\Magento\PageCache\Model\Cache\Type
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()]
);
category- product categoryoptions-\Magento\Framework\DataObject(['is_allow' => true])store- current store ID
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree\Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser
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()]
);
category- product categoryoptions-\Magento\Framework\DataObject(['is_allow' => true])store- current store ID
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree\Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser
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]);
options-\Magento\Framework\DataObject(['is_moveable' => true, 'category' => $node])
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree\Magento\Catalog\Block\Adminhtml\Category\Widget\Chooser
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]
);
formis an object of\Magento\Framework\Data\Formattributeis an object of\Magento\Catalog\Model\Entity\Attribute
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]
);
blockis an object of\Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Main
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]
);
blockis an object of\Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Main
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Attribute\Set\Toolbar\Main
adminhtml_catalog_product_edit_element_types
Use cases
To add or customize additional element types for catalog product edit attributes tab.
Origins
-
\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes::_getAdditionalElementTypes():protected function _getAdditionalElementTypes() { ... $this->_eventManager->dispatch('adminhtml_catalog_product_edit_element_types', ['response' => $response]); -
responseis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes
adminhtml_catalog_product_edit_prepare_form
Origins
-
\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes::_prepareForm():protected function _prepareForm() { ... $this->_eventManager->dispatch( 'adminhtml_catalog_product_edit_prepare_form', ['form' => $form, 'layout' => $this->getLayout()] ); -
\Magento\Catalog\Block\Adminhtml\Product\Attribute\NewAttribute\Product\Attributes::_prepareForm():protected function _prepareForm() { ... $this->_eventManager->dispatch('adminhtml_catalog_product_edit_prepare_form', ['form' => $form] ); -
formis an object of\Magento\Framework\Data\Form -
layoutis an object of\Magento\Framework\View\LayoutInterface
There are only three classes that raise this event:
\Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Attributes\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Magento\Catalog\Block\Adminhtml\Product\Attribute\NewAttribute\Product\Attributes
Use cases
To customize catalog product edit attribute tab form
adminhtml_catalog_product_edit_tab_attributes_create_html_before
Origins
-
\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Create::_toHtml():protected function _toHtml() { $this->setCanShow(true); $this->_eventManager->dispatch( 'adminhtml_catalog_product_edit_tab_attributes_create_html_before', ['block' => $this] ); -
blockis an object of\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Create
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Attributes\Create
Use cases
To customize catalog product edit create attribute block
adminhtml_catalog_product_form_prepare_excluded_field_list
Origins
-
\Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab\Attributes::_prepareForm():protected function _prepareForm(): void { $this->setFormExcludedFieldList($this->excludeFields); $this->_eventManager->dispatch( 'adminhtml_catalog_product_form_prepare_excluded_field_list', ['object' => $this] ); -
objectis an object of\Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab\Attributes
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Edit\Action\Attribute\Tab\Attributes
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
-
\Magento\Catalog\Block\Adminhtml\Product\Grid::_prepareMassaction():protected function _prepareMassaction() { ... $this->_eventManager->dispatch('adminhtml_catalog_product_grid_prepare_massaction', ['block' => $this]); return $this; } -
blockis an object of\Magento\Catalog\Block\Adminhtml\Product\Grid
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Grid\Magento\UrlRewrite\Block\Catalog\Product\Grid
adminhtml_cmspage_on_delete
Origins
-
\Magento\Cms\Controller\Adminhtml\Page\Delete::execute():protected function execute() { ... $this->_eventManager->dispatch('adminhtml_cmspage_on_delete', [ 'title' => $title, 'status' => 'success' ]); return $resultRedirect->setPath('*/*/'); } catch (\Exception $e) { $this->_eventManager->dispatch( 'adminhtml_cmspage_on_delete', ['title' => $title, 'status' => 'fail'] ); ... } -
titleis a string, title of a cms page -
statusis a string, 'success' or 'fail'
Classes raising the event
\Magento\Cms\Controller\Adminhtml\Page\Delete
Use cases
To perform actions on either successful or unsuccessful cms page removal
adminhtml_controller_catalogrule_prepare_save
Origins
-
\Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog\Save::execute():protected function execute() { ... try { $this->_eventManager->dispatch( 'adminhtml_controller_catalogrule_prepare_save', ['request' => $this->getRequest()] ); ... } -
requestis a page request object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog\Save
Use cases
To alter how a catalog price rule is being saved
adminhtml_controller_salesrule_prepare_save
Origins
-
\Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save::execute():protected function execute() { ... try { ... $this->_eventManager->dispatch( 'adminhtml_controller_salesrule_prepare_save', ['request' => $this->getRequest()] ); ... } -
requestis a page request object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\SalesRule\Controller\Adminhtml\Promo\Quote\Save
Use cases
To alter how a cart price rule is being saved
adminhtml_customer_orders_add_action_renderer
Origins
-
\Magento\Sales\Block\Adminhtml\Reorder\Renderer\Action::render():public function render(\Magento\Framework\DataObject $row) { ... $this->_eventManager->dispatch( 'adminhtml_customer_orders_add_action_renderer', ['renderer' => $this, 'row' => $row] ); -
rendereris an object of\Magento\Sales\Block\Adminhtml\Reorder\Renderer\Action -
rowis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Sales\Block\Adminhtml\Reorder\Renderer\Action
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()]
);
customeris an object of\Magento\Customer\Api\Data\CustomerInterfacerequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Customer\Controller\Adminhtml\Index\Save
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()]
);
customeris an object of\Magento\Customer\Api\Data\CustomerInterfacerequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Customer\Controller\Adminhtml\Index\Save
adminhtml_product_attribute_types
Use cases
To modify the way product attributes are processed.
Origins
-
\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Main::execute():private function processFrontendInputTypes(): void { ... $this->_eventManager->dispatch('adminhtml_product_attribute_types', ['response' => $response]); -
\Magento\Catalog\Model\Product\Attribute\Source\Inputtype::toOptionArray():public function toOptionArray() { ... $this->_eventManager->dispatch('adminhtml_product_attribute_types', ['response' => $response]);
response is an object of \Magento\Framework\DataObject
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Main\Magento\Catalog\Model\Product\Attribute\Source\Inputtype
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]
);
formis an object of\Magento\Framework\Data\Form
Classes raising the event
\Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Coupons\Form
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);
order_create_modelis an object of\Magento\Sales\Model\AdminOrder\Createrequestis an array of POST values
Classes raising the event
\Magento\Sales\Controller\Adminhtml\Order\Create\Cancel\Magento\Sales\Controller\Adminhtml\Order\Create\ProcessData
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);
order_create_modelis an object of\Magento\Sales\Model\AdminOrder\Createrequest_modelis an object of\Magento\Framework\App\RequestInterfacesessionis an object of\Magento\Backend\Model\Session\Quote
Classes raising the event
\Magento\Sales\Controller\Adminhtml\Order\Create\Cancel\Magento\Sales\Controller\Adminhtml\Order\Create\ProcessData
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);
order_create_modelis an object of\Magento\Sales\Model\AdminOrder\Createrequest_modelis an object of\Magento\Framework\App\RequestInterfacesessionis an object of\Magento\Backend\Model\Session\Quote
Classes raising the event
\Magento\Sales\Controller\Adminhtml\Order\Create\Cancel\Magento\Sales\Controller\Adminhtml\Order\Create\ProcessData
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);
order_create_modelis an object of\Magento\Sales\Model\AdminOrder\Createrequest_modelis an object of\Magento\Framework\App\RequestInterfacesessionis an object of\Magento\Backend\Model\Session\Quote
Classes raising the event
\Magento\Sales\Controller\Adminhtml\Order\Create\Cancel\Magento\Sales\Controller\Adminhtml\Order\Create\ProcessData
adminhtml_sales_order_creditmemo_register_before
Use cases
To modify a credit memo before it gets saved in the registry.
Origins
-
\Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader::load():public function load() { ... $this->eventManager->dispatch( 'adminhtml_sales_order_creditmemo_register_before', ['creditmemo' => $creditmemo, 'input' => $this->getCreditmemo()] ); -
creditmemois an object of\Magento\Sales\Model\Order\Creditmemo -
inputis a data array
Classes raising the event
\Magento\Sales\Controller\Adminhtml\Order\CreditmemoLoader
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]);
blockis an object of\Magento\Backend\Block\System\Store\Edit\AbstractForm
Classes raising the event
\Magento\Backend\Block\System\Store\Edit\Form\Website\Magento\Backend\Block\System\Store\Edit\Form\Group\Magento\Backend\Block\System\Store\Edit\Form\Store
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]
);
modulesis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Config\Block\System\Config\Form\Fieldset\Modules\DisableOutput
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]
);
collectionis an object of\Magento\Reports\Model\ResourceModel\Report\Collectionfilter_valuesis a value array
Classes raising the event
\Magento\Reports\Block\Adminhtml\Grid
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()]
);
objectis an object of\Magento\Authorization\Model\Rolerequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\User\Controller\Adminhtml\User\Role\SaveRole
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]
);
websiteis a website IDstoreis a store ID
Classes raising the event
\Magento\CurrencySymbol\Model\System\Currencysymbol
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]
);
websiteis a website IDstoreis a store ID
Classes raising the event
\Magento\CurrencySymbol\Model\System\Currencysymbol
admin_system_config_changed_section_design
Use cases
To perform actions after admin design section saved or deleted.
Origins
-
\Magento\Theme\Model\Design\Config\Plugin::afterSave():public function afterSave(DesignConfigRepository $subject, DesignConfigInterface $designConfig) { ... $this->eventManager->dispatch( 'admin_system_config_changed_section_design', ['website' => $website, 'store' => $store] ); -
\Magento\Theme\Model\Design\Config\Plugin::afterDelete():public function afterDelete(DesignConfigRepository $subject, DesignConfigInterface $designConfig) { ... $this->eventManager->dispatch( 'admin_system_config_changed_section_design', ['website' => $website, 'store' => $store] ); -
websiteis an object of\Magento\Store\Api\Data\WebsiteInterface -
storeis an object of\Magento\Store\Api\Data\StoreInterface
Classes raising the event
\Magento\Theme\Model\Design\Config\Plugin
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()]
);
configDatais a data arrayrequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Config\Controller\Adminhtml\System\Config\Save
admin_user_authenticate_after
Use cases
To perform actions after a user is authenticated.
Origins
-
\Magento\User\Model\User::authenticate():public function authenticate($username, $password) { ... $this->_eventManager->dispatch( 'admin_user_authenticate_after', ['username' => $username, 'password' => $password, 'user' => $this, 'result' => $result] ); -
\Magento\User\Model\User::performIdentityCheck():public function performIdentityCheck($passwordString) { ... $this->_eventManager->dispatch( 'admin_user_authenticate_after', [ 'username' => $this->getUserName(), 'password' => $passwordString, 'user' => $this, 'result' => $isCheckSuccessful ] ); -
usernameis a username string -
passwordis a password string -
useris an object of\Magento\User\Model\User -
resultis a boolean value
Classes raising the event
\Magento\User\Model\User
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]
);
usernameis a username stringuseris an object of\Magento\User\Model\User
Classes raising the event
\Magento\User\Model\User
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\Helper\Session
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]);
}
exceptionis an object ofMagento\Framework\Exception\ValidatorExceptionor\Exception
Classes raising the event
\Amazon\Login\Controller\Login\Authorize
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]);
}
exceptionis an object ofMagento\Framework\Exception\ValidatorException
Classes raising the event
\Amazon\Login\Controller\Login\Authorize
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
]
);
}
contextis a stringauthorizationpaymentis an object ofMagento\Payment\Model\InfoInterfacetransportis aDataObjectobject
Classes raising the event
\Amazon\Payment\Gateway\Request\AuthorizationRequestBuilder
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,
]
);
}
orderis an object of\Magento\Sales\Api\Data\OrderInterfacependingAuthorizationis an object of\Amazon\Payment\Api\Data\PendingAuthorizationInterface
Classes raising the event
\Amazon\Payment\Model\PaymentManagement\Authorization
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,
]
);
}
orderis an object of\Magento\Sales\Api\Data\OrderInterfacependingAuthorizationis an object of\Amazon\Payment\Api\Data\PendingAuthorizationInterface
Classes raising the event
\Amazon\Payment\Model\PaymentManagement\Authorization
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]);
}
themeis an object of\Magento\Framework\View\Design\ThemeInterface
Classes raising the event
\Magento\Theme\Observer\CheckThemeIsAssignedObserver
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]
);
}
storesis an array of storesscope- scope value defined in\Magento\Store\Model\ScopeInterfacethemeis an object of\Magento\Framework\View\Design\ThemeInterface
Classes raising the event
\Magento\Theme\Model\Config
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]
);
}
user_name- username stringexceptionis an object of\Magento\Framework\Exception\LocalizedExceptionor\Magento\Framework\Exception\Plugin\AuthenticationException
Classes raising the event
\Magento\Backend\Model\Auth
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()]
);
}
useris an object of\Magento\Backend\Model\Auth\Credential\StorageInterface
Classes raising the event
\Magento\Backend\Model\Auth
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()]
);
}
thisis an object of\Magento\Backend\Block\Widget\Gridcollectionis an object of\Magento\Framework\Data\Collection
Classes raising the event
\Magento\AdvancedSearch\Block\Adminhtml\Search\Grid\Magento\Newsletter\Block\Adminhtml\Subscriber\Grid
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
]);
}
quoteis an object of\Magento\Quote\Model\Quotegooglepay_responseis a response array
Classes raising the event
\PayPal\Braintree\Model\GooglePay\Helper\QuoteUpdater
braintree_googlepay_update_quote_before
Use cases
To perform actions before 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_before', [ 'quote' => $quote, 'googlepay_response' => $details ]); } -
quoteis an object of\Magento\Quote\Model\Quote -
googlepay_responseis a response array
Classes raising the event
\PayPal\Braintree\Model\GooglePay\Helper\QuoteUpdater
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
]);
}
quoteis an object of\Magento\Quote\Model\Quotepaypal_responseis a response array
Classes raising the event
\PayPal\Braintree\Model\Paypal\Helper\QuoteUpdater
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
]);
}
quoteis an object of\Magento\Quote\Model\Quotepaypal_responseis a response array
Classes raising the event
\PayPal\Braintree\Model\Paypal\Helper\QuoteUpdater
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()]
);
}
dirty_rulesis an object of\Magento\CatalogRule\Model\Flagmessageis a message string
Classes raising the event
\Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog\Index
catalogsearch_reset_search_result
Use cases
To perform actions when search results are reset.
Origins
-
\Magento\CatalogSearch\Model\ResourceModel\Fulltext::resetSearchResults():public function resetSearchResults() { ... $this->_eventManager->dispatch('catalogsearch_reset_search_result'); return $this; } -
\Magento\CatalogSearch\Model\ResourceModel\Fulltext::resetSearchResultsByStore():public function resetSearchResultsByStore($storeId) { ... $this->_eventManager->dispatch('catalogsearch_reset_search_result', ['store_id' => $storeId]);
store_id is a store identifier.
Classes raising the event
\Magento\CatalogSearch\Model\ResourceModel\Fulltext
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]
);
}
engineis an object of\Magento\CatalogSearch\Model\ResourceModel\EngineInterfaceattributesis an array of attributes
Classes raising the event
\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider
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]
);
}
collectionis an object of\Magento\Eav\Model\Entity\Collection\AbstractCollection
Classes raising the event
\Magento\Catalog\Block\Product\ProductList\Random\Magento\Catalog\Block\Product\ProductList\Promotion
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();
}
statusis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Reports\Block\Product\Compared\Magento\Reports\Block\Product\Widget\Viewed\Item
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]
);
}
categoryis an object of\Magento\Catalog\Model\Categoryproduct_idsis a product IDs array
Classes raising the event
\Magento\Catalog\Model\ResourceModel\Category
catalog_category_delete_after_done
Use cases
To perform actions after a category gets deleted.
Origins
-
\Magento\Catalog\Model\ResourceModel\Category::delete():public function delete($object) { $this->getEntityManager()->delete($object); $this->_eventManager->dispatch( 'catalog_category_delete_after_done', ['product' => $object, 'category' => $object] ); return $this; } -
productis an object of\Magento\Catalog\Model\Category -
categoryis an object of\Magento\Catalog\Model\Category
Classes raising the event
\Magento\Catalog\Model\ResourceModel\Category
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]);
selectis an object ofZend_Db_Select
Classes raising the event
\Magento\Catalog\Model\ResourceModel\Category\Flat
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()]
);
categoryis an object of\Magento\Catalog\Model\Categoryrequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Catalog\Controller\Adminhtml\Category\Save
catalog_category_tree_init_inactive_category_ids
Use cases
To add more inactive category IDs.
Origins
-
\Magento\Catalog\Model\ResourceModel\Category\Tree::_initInactiveCategoryIds() -
\Magento\Catalog\Model\ResourceModel\Category\Flat::_initInactiveCategoryIds():protected function _initInactiveCategoryIds() { $this->_inactiveCategoryIds = []; $this->_eventManager->dispatch('catalog_category_tree_init_inactive_category_ids', ['tree' => $this]); return $this; }
tree is an object of \Magento\Catalog\Model\ResourceModel\Category\Tree or \Magento\Catalog\Model\ResourceModel\Category\Flat
Classes that raise the event
\Magento\Catalog\Model\ResourceModel\Category\Tree\Magento\Catalog\Model\ResourceModel\Category\Flat
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]);
categoryis an object of\Magento\Catalog\Model\Category
Classes raising the event
\Magento\Catalog\Controller\Adminhtml\Category\Delete
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]
);
categoryis an object of\Magento\Catalog\Model\Categorycontroller_actionis an object of\Magento\Catalog\Controller\Category\View
Classes raising the event
\Magento\Catalog\Controller\Category\View
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]
);
productis an object of\Magento\Catalog\Model\Productcontroller_actionis an object of\Magento\Framework\App\Action\Action
Classes raising the event
\Magento\Catalog\Helper\Product
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]
);
paramsis an object of\Magento\Framework\DataObjectcontroller_actionis an object of\Magento\Framework\App\Action\Action
Classes raising the event
\Magento\Catalog\Helper\Product
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]);
productis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Catalog\Helper\Product\View
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);
selectis an object of\Magento\Framework\DB\Selecttableis a table namestore_idis a store IDresponse_objectis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Reports\Model\ResourceModel\Product\Lowstock\Collection\Magento\Reports\Model\ResourceModel\Product\Downloads\Collection
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]
);
attributes_datais a data arrayproduct_idsis a product IDs arraystore_idis a store ID
Classes raising the event
\Magento\Catalog\Model\Product\Action
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]
);
collectionis an object of\Magento\Catalog\Model\ResourceModel\Product\Collection
Classes raising the event
\Magento\Reports\Model\ResourceModel\Product\Downloads\Collection\Magento\Reports\Model\ResourceModel\Product\Lowstock\Collection
catalog_product_collection_before_add_count_to_categories
Use cases
To perform actions before category counts get added to a product collection.
Origins
-
\Magento\Catalog\Model\ResourceModel\Product\Collection::addCountToCategories():public function addCountToCategories($categoryCollection) { ... $this->_eventManager->dispatch( 'catalog_product_collection_before_add_count_to_categories', ['collection' => $this] ); -
collectionis an object of\Magento\Catalog\Model\ResourceModel\Product\Collection
Classes raising the event
\Magento\Reports\Model\ResourceModel\Product\Downloads\Collection\Magento\Reports\Model\ResourceModel\Product\Lowstock\Collection
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]);
collectionis an object of\Magento\Catalog\Model\ResourceModel\Product\Collection
Classes raising the event
\Magento\Reports\Model\ResourceModel\Product\Downloads\Collection\Magento\Reports\Model\ResourceModel\Product\Lowstock\Collection
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]);
productis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Catalog\Controller\Product\Compare\Add
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
\Magento\Catalog\Model\ResourceModel\Product\Compare\Item\Collection
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]
);
...
productis an object of\Magento\Catalog\Model\Product\Compare\Item
Classes raising the event
\Magento\Catalog\Controller\Product\Compare\Remove
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]
);
...
productis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Catalog\Model\ResourceModel\Product\Magento\CatalogImportExport\Model\Import\Proxy\Product\ResourceModel
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]);
productis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Edit\Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit\Edit
catalog_product_gallery_prepare_layout
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]);
blockis an object of\Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content
Classes raising the event
\Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Gallery\Content
catalog_product_gallery_upload_image_after
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]
);
resultis an array of uploader save dataactionis an object of\Magento\Catalog\Controller\Adminhtml\Product\Gallery\Upload
Classes raising the event
\Magento\Catalog\Controller\Adminhtml\Product\Gallery\Upload
catalog_product_get_final_price
Use cases
To alter the way the final product price is generated.
Origins
-
\Magento\Catalog\Model\Product\Type\Price::getFinalPrice():public function getFinalPrice($qty, $product) { ... $this->_eventManager->dispatch('catalog_product_get_final_price', ['product' => $product, 'qty' => $qty]); -
\Magento\Bundle\Pricing\Price\BundleSelectionPrice::getValue():public function getValue() { ... $this->eventManager->dispatch( 'catalog_product_get_final_price', ['product' => $product, 'qty' => $this->bundleProduct->getQty()] ); -
\Magento\Bundle\Model\Product\Price::getSelectionFinalTotalPrice():
public function getSelectionFinalTotalPrice(
$bundleProduct,
$selectionProduct,
$bundleQty,
$selectionQty,
$multiplyQty = true,
$takeTierPrice = true
) {
...
$this->_eventManager->dispatch(
'catalog_product_get_final_price',
['product' => $product, 'qty' => $bundleQty]
);
productis an object of\Magento\Catalog\Model\Productqtyfor quantity float or null
Classes raising the event
\Magento\Bundle\Model\Product\Price\Magento\Downloadable\Model\Product\Price\Magento\GroupedProduct\Model\Product\Type\Grouped\Price
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]
);
adapteris an object of\Magento\CatalogImportExport\Model\Import\Productbunchis a data array
Classes raising the event
\Magento\CatalogImportExport\Model\Import\Product
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,
]
);
adapteris an object of\Magento\CatalogImportExport\Model\Import\Productbunchis a data arrayids_to_deleteis a product IDs array
Classes raising the event
\Magento\CatalogImportExport\Model\Import\Product
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]
);
adapteris an object of\Magento\CatalogImportExport\Model\Import\Productbunchis a data array
Classes raising the event
\Magento\CatalogImportExport\Model\Import\Product
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]);
adapteris an object of\Magento\CatalogImportExport\Model\Import\Product
Classes raising the event
\Magento\CatalogImportExport\Model\Import\Product
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]
);
productis an object of\Magento\Catalog\Model\Productsalableis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\CatalogImportExport\Model\Import\Proxy\Product\Magento\Catalog\Model\Product
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]);
productis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\CatalogImportExport\Model\Import\Proxy\Product\Magento\Catalog\Model\Product
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]);
productis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Catalog\Controller\Adminhtml\Product\NewAction\Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit\NewAction\Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\NewAction
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]);
configObjis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Options
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')
]
);
selectis an object of\Magento\Framework\DB\Selectentity_fieldis aZend_Db_Exprobjectwebsite_fieldis aZend_Db_Exprobjectstore_fieldis aZend_Db_Exprobject
Classes raising the event
\Magento\Bundle\Model\ResourceModel\Indexer\Price
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]);
productsis a product IDs array
Classes raising the event
\Magento\Catalog\Model\Product\Action
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]
);
productis an object of\Magento\Catalog\Model\Productcollectionis an object of\Magento\Catalog\Model\ResourceModel\Product\Collectionlimit- null
Classes raising the event
\Magento\Catalog\Block\Product\ProductList\Upsell
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]
);
productis an object of\Magento\Catalog\Model\Productvariationsis an array
Classes raising the event
\Magento\ConfigurableProduct\Model\Product\Validator\Plugin
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]);
response_objectis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\ProductAlert\Block\Product\View\Stock\Magento\ProductAlert\Block\Product\View\Price
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);
category_moveis a data array
Classes raising the event
\Magento\Catalog\Model\Category
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]
);
responseis an object of\Magento\Framework\DataObjectcontrolleris an object of\Magento\Catalog\Controller\Adminhtml\Category
Classes raising the event
\Magento\Catalog\Controller\Adminhtml\Category\Grid\Magento\Catalog\Controller\Adminhtml\Category\RefreshPath
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]
);
engineis an object of\Magento\CatalogSearch\Model\ResourceModel\EngineInterfaceattributesis an array of attributes
Classes raising the event
\Magento\CatalogSearch\Model\Indexer\Fulltext\Action\DataProvider
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]
);
quoteis an object of\Magento\Quote\Model\Quotestoreis an integer or an object of\Magento\Store\Model\Storeresultis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Checkout\Helper\Data
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()]
);
productis an object of\Magento\Catalog\Model\Productrequestis an object of\Magento\Framework\App\RequestInterfaceresponseis an object of\Magento\Framework\App\ResponseInterface
Classes raising the event
\Magento\Checkout\Controller\Cart\Add
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]
);
infois an integer or an array or an object of\Magento\Framework\DataObjectproductis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Checkout\Model\Cart
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]
);
quote_itemis an object of\Magento\Quote\Model\Quote\Itemproductis an object of\Magento\Catalog\Model\Product
Classes raising the event
\Magento\Checkout\Model\Cart
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]);
cartis an object of\Magento\Checkout\Model\Cart
Classes raising the event
\Magento\Checkout\Model\Cart
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]);
cartis an object of\Magento\Checkout\Model\Cart
Classes raising the event
\Magento\Checkout\Model\Cart
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]
);
cartis an object of\Magento\Checkout\Model\Cartinfois an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Checkout\Model\Cart
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]
);
cartis an object of\Magento\Checkout\Model\Cartinfois an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Checkout\Model\Cart
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()]
);
itemis an object of\Magento\Quote\Model\Quote\Itemrequestis an object of\Magento\Framework\App\RequestInterfaceresponseis an object of\Magento\Framework\App\ResponseInterface
Classes raising the event
\Magento\Checkout\Controller\Cart\UpdateItemOptions
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()]
);
requestis an object of\Magento\Framework\App\RequestInterfacequoteis an object of\Magento\Quote\Model\Quote
Classes raising the event
\Magento\Multishipping\Controller\Checkout\ShippingPost
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
]
);
resultis an object of\Magento\Framework\DataObjectactionis an object of\Magento\Checkout\Controller\Onepage\SaveOrder
Classes raising the event
\Magento\Checkout\Controller\Onepage\SaveOrder
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;
}
ordersis an array of orders
Classes raising the event
\Magento\Multishipping\Model\Checkout\Type\Multishipping
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()
]
);
order_idsis an array of last order ID(s)orderis an object of\Magento\Sales\Model\Order
Classes raising the event
\Magento\Checkout\Controller\Onepage\Success
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()]);
quoteis an object of\Magento\Quote\Model\Quote
Classes raising the event
\Magento\Checkout\Model\Session
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]);
quoteis an object of\Magento\Quote\Model\Quote
Classes raising the event
\Magento\Checkout\Model\Session
checkout_submit_all_after
Use cases
To perform actions after an order was placed.
Origins
-
\Magento\Checkout\Model\Type\Onepage::saveOrder():public function saveOrder() { ... $this->_eventManager->dispatch( 'checkout_submit_all_after', [ 'order' => $order, 'quote' => $this->getQuote() ] ); -
\Magento\Sales\Model\AdminOrder\Create::createOrder():public function createOrder() { ... $this->_eventManager->dispatch('checkout_submit_all_after', ['order' => $order, 'quote' => $quote]); -
\Magento\Multishipping\Model\Checkout\Type\Multishipping::createOrders():public function createOrders() { ... $this->_eventManager->dispatch( 'checkout_submit_all_after', ['orders' => $orders, 'quote' => $this->getQuote()] ); -
\Magento\Quote\Model\QuoteManagement::placeOrder():public function placeOrder($cartId, PaymentInterface $paymentMethod = null) { ... $this->eventManager->dispatch('checkout_submit_all_after', ['order' => $order, 'quote' => $quote]); -
quoteis an object of\Magento\Quote\Model\Quote -
orderis an object of\Magento\Sales\Api\Data\OrderInterface
Classes raising the event
\Magento\Quote\Model\QuoteManagement\Magento\Multishipping\Model\Checkout\Type\Multishipping\Magento\Sales\Model\AdminOrder\Create\Magento\Checkout\Model\Type\Onepage
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]);
quoteis an object of\Magento\Quote\Model\Quote
Classes raising the event
\Magento\Quote\Model\QuoteManagement
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()]
);
quoteis an object of\Magento\Quote\Model\Quoteorderis an object of\Magento\Sales\Model\Orderaddressis an object of\Magento\Quote\Model\Quote\Address
Classes raising the event
\Magento\Multishipping\Model\Checkout\Type\Multishipping
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]);
quoteis an object of\Magento\Quote\Model\Quote
Classes raising the event
\Magento\Multishipping\Model\Checkout\Type\Multishipping
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()]
);
quoteis an object of\Magento\Quote\Model\Quoteorderis an object of\Magento\Sales\Model\Order
Classes raising the event
\Magento\Checkout\Model\Type\Onepage
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]);
...
objectis an object of\Magento\Framework\Indexer\CacheContext
Classes raising the event
\Magento\Indexer\Model\Processor\CleanCache
clean_cache_by_tags
Use cases
To perform actions at the time specific tags are cleaned from cache.
Origins
-
\Magento\Framework\Model\AbstractModel::afterSave():public function afterSave() { ... $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]); -
\Magento\Framework\Model\AbstractModel::afterDelete():public function afterSave() { ... $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]); -
\Magento\CatalogInventory\Model\Indexer\Stock\CacheCleaner::clean():public function clean(array $productIds, callable $reindex) { ... $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); -
\Magento\Catalog\Plugin\Model\Product\Action\UpdateAttributesFlushCache::afterUpdateAttributes():public function afterUpdateAttributes( \Magento\Catalog\Model\Product\Action $subject, \Magento\Catalog\Model\Product\Action $result ) { $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); return $result; } -
\Magento\Catalog\Plugin\Model\Product\Action\UpdateAttributesFlushCache::afterUpdateWebsites():public function afterUpdateWebsites( \Magento\Catalog\Model\Product\Action $subject ) { $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); } -
\Magento\Catalog\Model\Category::move():public function move($parentId, $afterCategoryId) { ... $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]); -
\Magento\Catalog\Model\Indexer\Product\Category\Action\Rows::execute():public function execute(array $entityIds = [], $useTempTable = false) { ... $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); -
\Magento\Catalog\Model\Indexer\Category\Product\Action\Rows::execute():public function execute(array $entityIds = [], $useTempTable = false) { ... $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); -
\Magento\InventoryCache\Model\FlushCacheByProductIds::execute():public function execute(array $productIds) { ... $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $cacheContext]); -
\Magento\CatalogRule\Model\Indexer\AbstractIndexer::executeFull():public function executeFull() { $this->indexBuilder->reindexFull(); $this->_eventManager->dispatch('clean_cache_by_tags', ['object' => $this]); -
\Magento\Indexer\Model\Indexer\CacheCleaner::cleanCache():private function cleanCache() { $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->cacheContext]); -
\Magento\Indexer\Model\Processor\CleanCache::afterReindexAllInvalid():public function afterReindexAllInvalid(\Magento\Indexer\Model\Processor $subject) { $this->eventManager->dispatch('clean_cache_by_tags', ['object' => $this->context]);
object is an object of \Magento\Framework\Indexer\CacheContext.
Classes raising the event
\Magento\Indexer\Model\Processor\CleanCache\Magento\Weee\Model\Tax\Magento\Reports\Model\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
\Magento\Backend\Controller\Adminhtml\Cache\CleanImages
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
\Magento\Backend\Controller\Adminhtml\Cache\CleanMedia
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
\Magento\Backend\Controller\Adminhtml\Cache\CleanStaticFiles
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]
);
routeris an object of\Magento\Cms\Controller\Routerconditionis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Cms\Controller\Router
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()]
);
pageis an object of\Magento\Cms\Model\Pagerequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Cms\Controller\Adminhtml\Page\Save
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()]
);
pageis an object of\Magento\Cms\Model\Pagerequestis an object of\Magento\Framework\App\RequestInterfacecontroller_actionis an object of\Magento\Framework\App\ActionInterface
Classes raising the event
\Magento\Cms\Helper\Page
cms_wysiwyg_images_static_urls_allowed
Use cases
To do change whether using static URLs is allowed or not.
Origins
-
\Magento\Cms\Helper\Wysiwyg\Images::isUsingStaticUrlsAllowed():public function isUsingStaticUrlsAllowed() { .... $this->_eventManager->dispatch( 'cms_wysiwyg_images_static_urls_allowed', ['result' => $checkResult, 'store_id' => $this->_storeId] ); -
resultis a PHP object variable -
store_idis a store ID
Classes raising the event
\Magento\Cms\Helper\Wysiwyg\Images
controller_action_catalog_product_save_entity_after
Use cases
To perform actions after a product has been saved in backend.
Origins
-
\Magento\Catalog\Controller\Adminhtml\Product\Save::execute():public function execute() { .... $this->_eventManager->dispatch( 'controller_action_catalog_product_save_entity_after', ['controller' => $this, 'product' => $product] ); -
productis an object of\Magento\Catalog\Model\Product -
controlleris an object of\Magento\Catalog\Controller\Adminhtml\Product\Save
Classes raising the event
\Magento\Catalog\Controller\Adminhtml\Product\Save\Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit\Save\Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit\Save
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,
]
);
requestis an object of\Magento\Framework\App\RequestInterfacesourceis an object of\Magento\InventoryApi\Api\Data\SourceInterface
Classes raising the event
\Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save
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,
]
);
requestis an object of\Magento\Framework\App\RequestInterfacestockis an object of\Magento\InventoryApi\Api\Data\StockInterface
Classes raising the event
\Magento\InventoryAdminUi\Model\Stock\StockSaveProcessor
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,
]
);
requestis an object of\Magento\Framework\App\RequestInterfacesourceis an object of\Magento\InventoryApi\Api\Data\SourceInterface
Classes raising the event
\Magento\InventoryAdminUi\Controller\Adminhtml\Source\Save
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
\Magento\Framework\App\View
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]
);
actionis an object of\Magento\Cookie\Controller\Index\NoCookiesredirectis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Cookie\Controller\Index\NoCookies
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]);
actionis an object of\Magento\Cookie\Controller\Index\NoCookiesstatusis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Framework\Controller\Noroute\Index
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));
controller_actionis an object of\Magento\Framework\App\ActionInterfacerequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Framework\App\Action\Plugin\EventDispatchPlugin
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));
...
controller_actionis an object of\Magento\Framework\App\ActionInterfacerequestis an object of\Magento\Framework\App\RequestInterface
Classes raising the event
\Magento\Framework\App\Action\Plugin\EventDispatchPlugin
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);
...
responseis an object of\Magento\Framework\App\Response\Httprequestis an object of\Magento\Framework\App\Request\Http
Classes raising the event
\Magento\Framework\App\Http
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
\Magento\TestFramework\Store\StoreManager
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
\Magento\Security\Model\ResourceModel\AdminSessionInfo\Collection\Magento\Store\Model\ResourceModel\Config\Collection\Scoped
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
\Magento\Security\Model\ResourceModel\AdminSessionInfo\Collection\Magento\Store\Model\ResourceModel\Config\Collection\Scoped
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
\Magento\Framework\View\Layout\Generator\Block
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]
);
element_nameis an element name stringlayoutis an object of\Magento\Framework\View\Layouttransportis an object of\Magento\Framework\DataObject
Classes raising the event
\Magento\Framework\View\Layout
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
\Magento\Cron\Observer\ProcessCronQueueObserver
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]
);
currency_optionsis an array of currency optionsbase_codeis a currency code string
Classes raising the event
\Magento\Framework\Locale\Currency
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()]
);
}
emailis a customer email
Classes raising the event
\Magento\Customer\Controller\Account\EditPost
customer_address_format
Use cases
To alter the way an address is formatted.
Origins
-
\Magento\Sales\Model\Order\Address\Renderer::format():public function format(Address $address, $type) { ... $this->eventManager->dispatch('customer_address_format', ['type' => $formatType, 'address' => $address]); } -
\Magento\Customer\Model\Address\AbstractAddress::format():public function format(Address $address, $type) { ... $this->eventManager->dispatch('customer_address_format', ['type' => $formatType, 'address' => $this]); } -
typeis an object of\Magento\Framework\DataObject -
addressis an object of either\Magento\Customer\Model\Address\AbstractAddressor\Magento\Sales\Model\Order\Address
Classes raising the event
\Magento\Sales\Model\Order\Address\Renderer\Magento\Customer\Model\Address\AbstractAddress\Magento\Customer\Model\Address
customer_customer_authenticated
Use cases
To perform actions after a customer has been authenticated.
Origins
-
\Magento\Customer\Model\Customer::authenticate():public function authenticate($login, $password) { .... $this->_eventManager->dispatch( 'customer_customer_authenticated', ['model' => $this, 'password' => $password] ); } -
\Magento\Customer\Model\AccountManagement::authenticate():public function authenticate($username, $password) { .... $this->eventManager->dispatch( 'customer_customer_authenticated', ['model' => $customerModel, 'password' => $password] ); } -
modelis an object of\Magento\Customer\Model\Customer -
passwordis a password string
Classes raising the event
\Magento\Customer\Model\Customer\Magento\Customer\Model\AccountManagement\Magento\Customer\Model\Backend\Customer
customer_data_object_login
Use cases
To perform actions after a customer has been logged in.
Origins
-
\Magento\Customer\Model\Session::setCustomerAsLoggedIn():public function setCustomerAsLoggedIn($customer) { .... $this->_eventManager->dispatch('customer_data_object_login', ['customer' => $this->getCustomerDataObject()]); } -
\Magento\Customer\Model\Session::setCustomerDataAsLoggedIn():public function setCustomerDataAsLoggedIn($customer) { .... $this->_eventManager->dispatch('customer_data_object_login', ['customer' => $customer]); } -
\Magento\Customer\Model\AccountManagement::authenticate():public function authenticate($username, $password) { .... $this->eventManager->dispatch('customer_data_object_login', ['customer' => $customer]); } -
customeris an object of\Magento\Customer\Api\Data\CustomerInterface
Classes raising the event
\Magento\Customer\Model\Session\Magento\Customer\Model\AccountManagement
customer_login
Use cases
To perform actions after a customer has been logged in.
Origins
-
\Magento\Customer\Model\Session::setCustomerAsLoggedIn():public function setCustomerAsLoggedIn($customer) { .... $this->_eventManager->dispatch('customer_login', ['customer' => $customer]); } -
\Magento\Customer\Model\Session::setCustomerDataAsLoggedIn():public function setCustomerDataAsLoggedIn($customer) { .... $this->_eventManager->dispatch('customer_login', ['customer' => $customerModel]); } -
\Magento\Integration\Model\CustomerTokenService::createCustomerAccessToken():
public function createCustomerAccessToken($username, $password)
{
...
$this->eventManager->dispatch('customer_login', ['customer' => $customerDataObject]);
customeris an object of either\Magento\Customer\Api\Data\CustomerInterfaceor\Magento\Customer\Model\Customer
Classes raising the event
\Magento\Customer\Model\Session\Magento\Integration\Model\CustomerTokenService
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
\Magento\Customer\Model\Session