Get the list of events from any version of magento

get list of events
If you want to get the list of all the events available in your magento version, you can achieve this by running the following code -:

$eventAreas = array('global','frontend','adminhtml');
foreach ($eventAreas as $eventArea) {
    $eventConfig = Mage::app()->getConfig()
                       ->getNode(sprintf('%s/events', $eventArea));
    foreach($eventConfig->children() as $key=>$value)
    {
        foreach($value->observers->children() as $key1=>$value1)
        {
            $observer_method = array((string)$eventArea,
            (string)$key,
            (string)$key1,
            (string)Mage::app()->getConfig()
                        ->getModelClassName($value1->class),
            (string)$value1->method);
             echo '<pre>';
             print_r($observer_method);
             echo '</pre>';
        }
    }
}

Hope this article helped you in some way. Please leave us your comment and let us know what do you think? Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *