Plugins are the brand new way of extending Magento 2 and, as often happens according to the law of the instrument, if all we have is a hammer, everything looks like a nail. This article will see the main differences between the good old events and plugins and when it still makes sense to use events instead of plugins to hook our customizations.
In this tutorial, I will guide you through the popular events and observers which works based on event driven architecture which is also referred as publish-subscribe pattern.
In Adobe Commerce, an observer is a special kind of tool that listens for certain actions or events happening in the system and then reacts to those actions. Think of it as someone who is "watching" for specific things happening and then doing something when they happen.
25 Nov 2024