Magento CE 18.104.22.168
Trying to fulfill a client's far-fetched request. Their previous developer created a module which allows the success/order confirmation page to be a CMS page which then references a PHTML file within the template. It was meant to facilitate programmatic order creation at a later point in time. For now, to confirm customer orders, it no longer uses success.phtml but an arbitrary file.
To over-simplify the question: What does it take to echo a customer's most recent order ID on a CMS page? Inside of this CMS page, it's referencing a core/template PHTML file. I'm able to render any static content from that file without issue but I can't echo any order data.
I attempted to make use of the success.phtml code and several other standard variations without success.
<?php $order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId()); ?>
Then just echo $order->getId() somewhere but obviously that does not work out of the box.
How would I proceed to call the most recent order information from a CMS page? Thanks.