1

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?

2

Was easier than what I thought:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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