I am trying to get the order value from success.phtml page so that I can report it back in the facebook pixel.
I am just looking for the simplest way to get the order value. Yes, a shortcut pretty much.
I tried this:
$orderTotal = round($block->getGrandTotal(), 2);
$lastOrderId = $block->getOrderId(); $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $order = $objectManager->create('Magento\Sales\Model\Order')->load($lastOrderId); echo "order id: ". $lastOrderId; echo $order->getGrandTotal();
and several other methods but the total order value seems to be hard to find.