Working with event listeners is better than rewriting a core class. When analyzing a process, it is good to think about how you can do it and if it is possible to work with the Magento events.
Before we can do that, we have to see which events are available, when they are dispatched, and which parameters are sent with the event.
In this recipe, we will explore how the Magento event system works. We will use the Magento log system to debug a core class to see which events are available and when they are dispatched.
Follow the ensuing instructions to see the event system in action:
When debugging something, it is recommended that you enable Magento logging. You can do this by configuring it in the backend. Navigate to System | Configuration | Advanced | Developer. Configure the Enabled parameter as shown in the following screenshot: