Introduction
In the Magento application, there are a lot of events that happen when visitors are browsing through your website. The visitor can add something to the cart, log in, create an order, and do a lot more.
Magento has an event system that fires events when some actions happens in your shop. With a configuration, it is possible to execute some code when an event occurs. It's like hooking into a click event in JavaScript.
The observer design pattern is used to implement the event handling system. When an event is triggered, Magento looks for event observers that hook into that event and execute the right method that is configured for that event handler.
Another similar system in Magento is a cronjob. In the configuration, you can create a cronjob that will be executed on a specific timestamp. When it is the right time, Magento will execute the code that is configured for that cronjob.
In this chapter, we will explore the possibilities of using these two systems (Event handlers and cronjobs...