Here I want to generate a Custom Invoice with Custom data and format right after default invoice generation.
So I have added an observer sales_order_invoice_pay
. here I want to get Order Id but I have no idea how can I get order id in this observer.
$order = $observer->getEvent()->getOrder();
$orderId = $order->getId(); //returning NULL
$order = $observer->getEvent()->getOrder();
$incrementId = $order->getIncrementId();//returning NULL
How can I get order id in this observer?
Thanks in Advance.