This question already has an answer here:
i created an own module for a new block in success.phtml and created a Plugin in my own module. Read my old post here: How to get an order id in success.phtml block?
In my success.phtml file i have the following code:
$order = $block->getCurrentOrder(); $orderId= $order->getId();
On the successpage i get the following error:
Call to a member function
getId() on null in
Why its not possible to access the function?? Any error on the Code?