Magento Offers a very basic “THANK YOU PAGE”. In major E-commerce website they provide a “THANK YOU PAGE” with all order details and summary.
We had the same requirement for our customer. I created a Thank You page with all Order Summary and Order Details in Magento.
I’ll try to cover this up in two posts.
Goto : app/design/frontend/YOURTHEME/default/template/checkout/success.phtml
Part – I : How to bring the Order Summary
I’ll Try to explain the code when necessary, First we will cover the code for Order Summary
Foremost, We need to create the object for Order placed. Create it using
$orderObj = Mage::getModel(‘sales/order’)->loadByIncrementId($this->getOrderId());
Get the object of the Last Order Placed
$lastOrder = Mage::getModel(‘sales/order’)->load(Mage::getSingleton(‘checkout/session’)->getLastOrderId());
From the Last Order Object, billing and shipping address can be obtained. Use following code for it.
$billingAddress = $lastOrder->getBillingAddress();
$shippingAddress = $lastOrder->getShippingAddress();
Suppose, You want to get the detailed Shipping Information use the following code for it.
To Get the Date of the Order, use following code
To Get the Grand Total use following Code
We will cover how to get all order details as shown in the image in Next Post. Please provide your feedback and comments on it.