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?

1 Answer 1


Was easier than what I thought:

public function paymentSuccessful($observer)
    $invoice = $observer->getEvent()->getInvoice();
    $order = $invoice->getOrder();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.