I need to add my own function on Order View page, but how can I get the orderID programmatically on the current order I'm viewing?
I have tried this code so far, which is triggered when Adding Order Comment
public function commentSaveAfter($observer)
{
$orderIds = $observer->getEvent()->getOrder()->getId();
$from_shipment = false;
if (!empty($orderIds))
{
}
}
it gives me an error,
Fatal error: Call to a member function getId() on null in