开发者

What's the earliest possible observer to hook into after payment in Magento?

开发者 https://www.devze.com 2023-03-14 21:46 出处:网络
I\'m looking to add some data generated after payment (API key) that I can then add into the email that goes out confirming the order. So far every event I\'ve tried happens either too soon (before pa

I'm looking to add some data generated after payment (API key) that I can then add into the email that goes out confirming the order. So far every event I've tried happens either too soon (before payment) or too late (the email is gone already).

What I could really use is not just a list of events, but the order in which they trigger.. I've tried several, including sales_order_payment_pay, sales_order_pla开发者_开发技巧ce_before, checkout_onepage_controller_success_action and so on..


Add some temporary debugging code to app/Mage.php

File: app/Mage.php    
public static function dispatchEvent($name, array $data = array())
{       
    Mage::Log('Event: ' . $name);
    //use below line of calling Mage::Log doesn't work (happens in rare cases)
    //file_put_contents('/tmp/events.log',"$name\n",FILE_APPEND);
    Varien_Profiler::start('DISPATCH EVENT:'.$name);
    $result = self::app()->dispatchEvent($name, $data);
    #$result = self::registry('events')->dispatch($name, $data);
    Varien_Profiler::stop('DISPATCH EVENT:'.$name);
    return $result;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消