Jump to content

Total Amount of order on Confirmation Page - how?


Recommended Posts

I assume you are talking about the order confirmation page after after payment. Most module will pass back "id_cart" as URL parameter.

 

You can use this to get Total amount from cart, then set it to smarty variable, this has to be done in OrderConfirmationController.php.

 

after following lines


public function preProcess()
{
parent::preProcess();

$this->id_cart = (int)(Tools::getValue('id_cart', 0));

 

 

 

INSERT following lines

 

 

$theCart = new Cart($this->id_cart);
$total_products = $theCart->getOrderTotal(false, Cart::ONLY_PRODUCTS);
self::$smarty->assign('total_products ', $total_products );

 

 

Then you can use variable at theme file

 

/themes/YourTheme/order-confirmation.tpl

 

{l s='You total amount of products is:'}  {$total_products }


 

Hope this helps

 

Note:

Condition, the payment must pass the id_cart to the order-confirmation.php page. (usually most payment module will do that)

Edited by shokinro (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...