Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add total price in checkout success page

Tags:

magento

I need to know, if any solution how to add in magento success.phtml order's total price? Because I want after placed order, customer get all info how to make payment including what price need to pay, because customer don't remember in last step what is total price.

like image 953
Brek Avatar asked Jan 30 '12 10:01

Brek


2 Answers

You could use something like this in your success.phtml:

$sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$oOrder = Mage::getModel('sales/order')->load($sOrderId);
echo $oOrder->getGrandTotal();
like image 143
Jürgen Thelen Avatar answered Oct 26 '22 13:10

Jürgen Thelen


in success.phtml template you can use

$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$total = $order->getGrandTotal();

proper way is to extend the Mage_Checkout_Block_Onepage_Success and add your own method for loading the order again (As in this page quote is inactive already) as it is not nice to load such stuff in templates

like image 26
Anton S Avatar answered Oct 26 '22 12:10

Anton S