Magento – How to get an order id in success.phtml block

blocksmagento2order-success-page

I created an own module for a new block in success.phtml. Read my old post here:
Magento 2: Override success.phtml

Now, I want to go get the order id in my own success.phtml file.

Tried with:

    $block->getOrderId() and $this->getOrderId() 

but I don't get the id. Any idea what I need to call to get the order id?

Best Answer

You can use $block->getRealOrderId()

Related Topic