I'm trying to hook into the sales_order_place_after
method in my observer and save information about the just placed order into a new database table. I'm able to hook into the event successfully, but when I try to access the order object, I keep getting the error User Error: Some transactions have not been committed or rolled back
.
This is my config.xml:
<sales_order_place_after>
<observers>
<myaction_save_order>
<type>singleton</type>
<class>mymodule/observer</class>
<method>saveOrderIdToAttendees</method>
</myaction_save_order>
</observers>
</sales_order_place_after>
This works fine. The problem I'm getting is in my observer:
public function saveOrderIdToAttendees($observer) {
$this->getHelper()->log('Helloooo');
$order = $observer->getEvent()->getOrder();
$this->getHelper()->log($order);
}
For some reason I don't even have access to the getEvent()
method. I've tried logging just the $observer->getEvent()
object and that gives me the same error.