Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
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?
Was easier than what I thought:
public function paymentSuccessful($observer)
$invoice = $observer->getEvent()->getInvoice();
$order = $invoice->getOrder();
Required, but never shown