Add total price on checkout success page

I need to know if any solution, how to add the total cost of the order to magento success.phtml? Since I want the customer to receive all the information on how to make the payment after placing the order, including what price you need to pay, because the customer does not remember at the last step what the total price is.

+6
source share
2 answers

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

 $sOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); $oOrder = Mage::getModel('sales/order')->load($sOrderId); echo $oOrder->getGrandTotal(); 
+12
source

in success.phtml template you can use

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

The correct way is to extend Mage_Checkout_Block_Onepage_Success and add your own method to Mage_Checkout_Block_Onepage_Success order (as on this page, the quote is already inactive), since it is not good to load such material into templates

+9
source

Source: https://habr.com/ru/post/907216/


All Articles