views:

57

answers:

1

Hi people,

When I look at the event (checkout_onepage_controller_success_action) and works, but I can not get the Id of the newly created order.

Anyone have any idea??

Use magento-1.4.1.0

Thanks

A: 

That event probably gets called before the action itself executes. Can you use sales_order_save_after instead?


EDIT: Here's your ID code. In your observer:

public function setLinkStatus($observer) {
    $order = $observer->getEvent()->getOrder(); 
    $id = $order->getId();

    // do something useful
}
Joseph Mastey
If you also work, but as I get the id?I am a little lostThanks
Zarpele
I've added the code you need to get the ID from that event. If you need more clarification on how to set up an observer, others have covered that in other questions in great detail.
Joseph Mastey
I already tried that, and does not work,thank you very muchcontinue to investigate ...
Zarpele
Okay, in what way did it not work? This code was pulled from app/code/core, so it works normally. Do you get an error? do you intercept the event at all? A little more detail, please.
Joseph Mastey