Hello Everyone,
In this blog, we will learn about Magento 2 Events and Its Uses.
What are Magento 2 Events?
Events are dispatched by modules when certain actions are triggered. When an Event is dispatched data is passed to the observer which is configured to watch that particular event.
Events are dispatched at various points in Magento’s workflow (e.g., when a product is saved, a customer logs in, or an order is placed).
For instance, when a customer logs in, an event is dispatched, enabling an observer to execute a predefined action, such as sending a welcome email, recording login activity, or integrating with external systems. Similarly, during checkout, events can be used to customize workflows, such as applying special discounts or triggering third-party API calls.
Without wasting your time, let us guide you straight away. Below is a list of Magento 2 Events.
LIST OF MAGENTO 2 EVENTS
Event Name | File |
abstract_search_result_load_after | vendor/magento/framework/Data/AbstractSearchResult.php |
abstract_search_result_load_before | vendor/magento/framework/Data/AbstractSearchResult.php |
adminhtml_block_eav_attribute_edit_form_init | vendor/magento/module-eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php |
adminhtml_block_html_before | vendor/magento/module-customer/Block/Adminhtml/Edit/Tab/Carts.php |
adminhtml_block_promo_widget_chooser_prepare_collection | vendor/magento/module-sales-rule/Block/Adminhtml/Promo/Widget/Chooser.php |
adminhtml_block_salesrule_actions_prepareform | vendor/magento/module-sales-rule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php |
adminhtml_cache_flush_all | vendor/magento/module-backend/Console/Command/CacheFlushCommand.php |
adminhtml_cache_flush_system | vendor/magento/module-backend/Console/Command/CacheCleanCommand.php |
adminhtml_cache_refresh_type | vendor/magento/module-page-cache/Model/Cache/Type.php |
adminhtml_catalog_category_tree_can_add_root_category | vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php |
adminhtml_catalog_category_tree_can_add_sub_category | vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php |
adminhtml_catalog_category_tree_is_moveable | vendor/magento/module-catalog/Block/Adminhtml/Category/Tree.php |
adminhtml_catalog_product_attribute_edit_frontend_prepare_form | vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php |
adminhtml_catalog_product_attribute_set_main_html_before | vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Set/Main.php |
adminhtml_catalog_product_attribute_set_toolbar_main_html_before | vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main.php |
adminhtml_catalog_product_edit_element_types | vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php |
adminhtml_catalog_product_edit_prepare_form | vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Attributes.php |
adminhtml_catalog_product_edit_tab_attributes_create_html_before | vendor/magento/module-catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php |
adminhtml_catalog_product_form_prepare_excluded_field_list | vendor/magento/module-catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php |
adminhtml_catalog_product_grid_prepare_massaction | vendor/magento/module-catalog/Block/Adminhtml/Product/Grid.php |
adminhtml_cmspage_on_delete | vendor/magento/module-cms/Controller/Adminhtml/Page/Delete.php |
adminhtml_controller_catalogrule_prepare_save | vendor/magento/module-catalog-rule/Controller/Adminhtml/Promo/Catalog/Save.php |
adminhtml_controller_salesrule_prepare_save | vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php |
adminhtml_customer_orders_add_action_renderer | vendor/magento/module-sales/Block/Adminhtml/Reorder/Renderer/Action.php |
adminhtml_customer_prepare_save | vendor/magento/module-customer/Controller/Adminhtml/Index/Save.php |
adminhtml_customer_save_after | vendor/magento/module-customer/Controller/Adminhtml/Index/Save.php |
adminhtml_product_attribute_types | vendor/magento/module-catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Main.php |
adminhtml_promo_quote_edit_tab_coupons_form_prepare_form | vendor/magento/module-sales-rule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php |
adminhtml_sales_order_create_process_data | vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php |
adminhtml_sales_order_create_process_data_before | vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php |
adminhtml_sales_order_create_process_item_after | vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php |
adminhtml_sales_order_create_process_item_before | vendor/magento/module-sales/Controller/Adminhtml/Order/Create.php |
adminhtml_sales_order_creditmemo_register_before | vendor/magento/module-sales/Controller/Adminhtml/Order/CreditmemoLoader.php |
adminhtml_store_edit_form_prepare_form | vendor/magento/module-backend/Block/System/Store/Edit/AbstractForm.php |
adminhtml_system_config_advanced_disableoutput_render_before | vendor/magento/module-config/Block/System/Config/Form/Fieldset/Modules/DisableOutput.php |
adminhtml_widget_grid_filter_collection | vendor/magento/module-reports/Block/Adminhtml/Grid.php |
admin_permissions_role_prepare_save | vendor/magento/module-user/Controller/Adminhtml/User/Role/SaveRole.php |
admin_system_config_changed_section_currency | vendor/magento/module-currency-symbol/Model/System/Currencysymbol.php |
admin_system_config_changed_section_currency_before_reinit | vendor/magento/module-currency-symbol/Model/System/Currencysymbol.php |
admin_system_config_changed_section_design | vendor/magento/module-theme/Model/Design/Config/Plugin.php |
admin_system_config_save | vendor/magento/module-config/controller/Adminhtml/System/Config/save.php |
admin_user_authenticate_after | vendor/magento/module-user/Model/User.php |
admin_user_authenticate_before | vendor/magento/module-user/Model/User.php |
assigned_theme_changed | vendor/magento/module-theme/Observer/CheckThemeIsAssignedObserver.php |
assign_theme_to_stores_after | vendor/magento/module-theme/Model/Config.php |
backend_auth_user_login_failed | vendor/magento/module-backend/Model/Auth.php |
backend_auth_user_login_success | vendor/magento/module-backend/Model/Auth.php |
backend_block_widget_grid_prepare_grid_before | vendor/magento/module-backend/Block/Widget/Grid.php |
catalogrule_dirty_notice | vendor/magento/module-catalog-rule/Controller/Adminhtml/Promo/Catalog/Index.php |
catalogsearch_reset_search_result | vendor/magento/module-catalog-search/Model/ResourceModel/Fulltext.php |
catalogsearch_searchable_attributes_load_after | vendor/magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php |
catalog_block_product_list_collection | vendor/magento/module-catalog/Block/Product/ListProduct.php |
catalog_block_product_status_display | vendor/magento/module-catalog/Block/Product/AbstractProduct.php |
catalog_category_change_products | vendor/magento/module-catalog/Model/ResourceModel/Category.php |
catalog_category_delete_after_done | vendor/magento/module-catalog/Model/ResourceModel/Category.php |
catalog_category_flat_loadnodes_before | vendor/magento/module-catalog/Model/ResourceModel/Category/Flat.php |
catalog_category_prepare_save | vendor/magento/module-catalog/Controller/Adminhtml/Category/Save.php |
catalog_category_tree_init_inactive_category_ids | vendor/magento/module-catalog/Model/ResourceModel/Category/Flat.php |
catalog_controller_category_delete | vendor/magento/module-catalog/Controller/Adminhtml/Category/Delete.php |
catalog_controller_category_init_after | vendor/magento/module-catalog/Controller/Category/View.php |
catalog_controller_product_init_after | vendor/magento/module-catalog/Helper/Product.php |
catalog_controller_product_init_before | vendor/magento/module-catalog/Helper/Product.php |
catalog_controller_product_view | vendor/magento/module-catalog/Helper/Product/View.php |
catalog_prepare_price_select | vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php |
catalog_product_attribute_update_before | vendor/magento/module-catalog/Model/Product/Action.php |
catalog_product_collection_apply_limitations_after | vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php |
catalog_product_collection_before_add_count_to_categories | vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php |
catalog_product_collection_load_after | vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php |
catalog_product_compare_add_product | vendor/magento/module-catalog/Controller/Product/Compare/Add.php |
catalog_product_compare_item_collection_clear | vendor/magento/module-catalog/Model/ResourceModel/Product/Compare/Item/Collection.php |
catalog_product_compare_remove_product | vendor/magento/module-catalog/Controller/Product/Compare/Remove.php |
catalog_product_delete_after_done | vendor/magento/module-catalog/Model/ResourceModel/Product.php |
catalog_product_edit_action | vendor/magento/module-catalog/Controller/Adminhtml/Product/Edit.php |
catalog_product_gallery_prepare_layout | vendor/magento/module-catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php |
catalog_product_gallery_upload_image_after | vendor/magento/module-catalog/Controller/Adminhtml/Product/Gallery/Upload.php |
catalog_product_get_final_price | vendor/magento/module-bundle/Model/Product/Price.php |
catalog_product_import_bunch_delete_after | vendor/magento/module-catalog-url-rewrite/etc/events.xml |
catalog_product_import_bunch_delete_commit_before | vendor/magento/module-catalog-import-export/Model/Import/Product.php |
catalog_product_import_bunch_save_after | vendor/magento/module-catalog-import-export/Model/Import/Product.php |
catalog_product_import_finish_before | vendor/magento/module-catalog-import-export/Model/Import/Product.php |
catalog_product_is_salable_after | vendor/magento/module-catalog/Model/Product.php |
catalog_product_is_salable_before | vendor/magento/module-catalog/Model/Product.php |
catalog_product_new_action | vendor/magento/module-catalog/Controller/Adminhtml/Product/NewAction.php |
catalog_product_option_price_configuration_after | vendor/magento/module-bundle/Block/Catalog/Product/View/Type/Bundle.php |
catalog_product_prepare_index_select | vendor/magento/module-bundle/Model/ResourceModel/Indexer/Price.php |
catalog_product_to_website_change | vendor/magento/module-catalog/Controller/Adminhtml/Product/Action/Attribute/Save.php |
catalog_product_upsell | vendor/magento/module-catalog/Block/Product/ProductList/Upsell.php |
catalog_product_validate_variations_before | vendor/magento/module-configurable-product/Model/Product/Validator/Plugin.php |
catalog_product_view_config | vendor/magento/module-catalog/Block/Product/View.php |
category_move | vendor/magento/module-catalog/Model/Category.php |
category_prepare_ajax_response | vendor/magento/module-catalog/Controller/Adminhtml/Category.php |
catelogsearch_searchable_attributes_load_after | vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Action/DataProvider.php |
checkout_allow_guest | vendor/magento/module-checkout/Helper/Data.php |
checkout_cart_add_product_complete | vendor/magento/module-checkout/Controller/Cart/Add.php |
checkout_cart_product_add_before | vendor/magento/Checkout/Model/Cart.php |
checkout_cart_product_update_after | vendor/magento/module-checkout/Model/Cart.php |
checkout_cart_save_after | vendor/magento/module-checkout/Model/Cart.php |
checkout_cart_save_before | vendor/magento/module-checkout/Model/Cart.php |
checkout_cart_update_items_after | vendor/magento/module-checkout/Model/Cart.php |
checkout_cart_update_items_before | vendor/magento/module-checkout/Model/Cart.php |
checkout_cart_update_item_complete | vendor/magento/module-checkout/Controller/Cart/UpdateItemOptions.php |
checkout_controller_multishipping_shipping_post | vendor/magento/module-multishipping/Controller/Checkout/ShippingPost.php |
checkout_controller_onepage_saveOrder | vendor/magento/module-checkout/Controller/Onepage/SaveOrder.php |
checkout_multishipping_refund_all | vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php |
checkout_onepage_controller_success_action | vendor/magento/module-checkout/Controller/Onepage/Success.php |
checkout_quote_destroy | vendor/magento/module-checkout/Model/Session.php |
checkout_quote_init | vendor/magento/module-checkout/Model/Session.php |
checkout_submit_all_after | vendor/magento/module-checkout/Model/Type/Onepage.php |
checkout_submit_before | vendor/magento/module-quote/Model/QuoteManagement.php |
checkout_type_multishipping_create_orders_single | vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php |
checkout_type_multishipping_set_shipping_items | vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php |
checkout_type_onepage_save_order_after | vendor/magento/module-checkout/Model/Type/Onepage.php |
clean_cache_after_reindex | vendor/magento/module-indexer/Model/Processor/CleanCache.php |
clean_cache_by_tags | vendor/magento/framework/Model/AbstractModel.php |
clean_catalog_images_cache_after | vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanImages.php |
clean_media_cache_after | vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanMedia.php |
clean_static_files_cache_after | vendor/magento/module-backend/Controller/Adminhtml/Cache/CleanStaticFiles.php |
cms_controller_router_match_before | vendor/magento/module-cms/Controller/Router.php |
cms_page_prepare_save | vendor/magento/module-cms/Controller/Adminhtml/Page/Save.php |
cms_page_render | vendor/magento/module-cms/Helper/Page.php |
cms_wysiwyg_images_static_urls_allowed | vendor/magento/module-cms/Helper/Wysiwyg/Images.php |
controller_action_catalog_product_save_entity_after | vendor/magento/module-catalog/Controller/Adminhtml/Product/Save.php |
controller_action_inventory_populate_source_with_data | venodor/magento/module-InventoryAdminUi/Controller/Adminhtml/Source/Save.php |
controller_action_inventory_populate_stock_with_data | venodor/magento/module-InventoryAdminUi/Controller/Adminhtml/Source/Save.php |
controller_action_inventory_source_save_after | venodor/magento/module-InventoryAdminUi/Controller/Adminhtml/Source/Save.php |
controller_action_layout_render_before | vendor/magento/framework/App/View.php |
controller_action_nocookies | vendor/magento/module-cookie/Controller/Index/NoCookies.php |
controller_action_noroute | vendor/magento/framework/Controller/Noroute/Index.php |
controller_action_postdispatch | vendor/magento/framework/App/Action/Action.php |
controller_action_predispatch | vendor/magento/framework/App/Action/Action.php |
controller_front_send_response_before | vendor/magento/framework/App/Http.php |
core_collection_abstract_load_after | vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php |
core_collection_abstract_load_before | vendor/magento/framework/Model/ResourceModel/Db/Collection/AbstractCollection.php |
core_layout_block_create_after | vendor/magento/framework/View/Layout/Generator/Block.php |
core_layout_render_element | vendor/magento/framework/View/Layout.php |
cron_job_run | vendor/magento/Cron/Observer/ProcessCronQueueObserver.php |
currency_display_options_forming | vendor/magento/framework/Locale/Currency.php |
customer_account_edited | vendor/magento/module-customer/Controller/Account/EditPost.php |
customer_address_format | vendor/magento/module-customer/Model/Address/AbstractAddress.php |
customer_customer_authenticated | vendor/magento/module-customer/Model/AccountManagement.php |
customer_data_object_login | vendor/magento/module-customer/Model/AccountManagement.php |
customer_login | vendor/magento/module-customer/Model/Session.php |
customer_logout | vendor/magento/module-customer/Model/Session.php |
Final Thoughts:
So this was the easiest way which we have told you in this blog. This is a List of Magento 2 Events. Hope you liked the blog.
So quickly go to the comment box and tell me how you like this blog?
Stay tuned with us on our site to get new updates of Magento.
Thanks for reading and visiting our site.