Magento 1.8 – Get Order from Invoice

event-observerinvoicemagento-1.8

I have an observer running on sales_order_invoice_save_after. I am able to retrieve the invoice from this observer however I am having some issues retrieving the order from the invoice. How can I retrieve an order from an invoice?

Best Answer

Was easier than what I thought:

public function paymentSuccessful($observer)
{
    $invoice = $observer->getEvent()->getInvoice();
    $order = $invoice->getOrder();
    print_r($order->getData());
}
Related Topic