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
Was easier than what I thought:
public function paymentSuccessful($observer)
{
$invoice = $observer->getEvent()->getInvoice();
$order = $invoice->getOrder();
print_r($order->getData());
}