Jump to content

export variables from php to tpl


dias11

Recommended Posts

Hi to all,

I would like to export the following data from my cart and pass the as variables to order-confirmation.tpl.

 

order_id
total cost

shipping cost

tax 

 

reading previous post i have know that i have to manage with OrderConfirmationController.php file. 

 

until now i am using successfully 

 

 $Totalcost = new Order($this->id_order);
 
 
   
  
   $this->context->smarty->assign(array(
   'revenue'=>$Totalcost->getOrdersTotalPaid()
 
My problem is that i cant find any function like the getOrdersTotalPaid() for the order_id, shipping cost and tax.
can you please guide me ?
 
Thanks 
 
Link to comment
Share on other sites

Order is object that contains all order related information.

By using code, you have got all order related information.

$myorder = new Order($this->id_order); $this->context->smarty->assign(array( 'myorder'=>$myorder));

should be able to get all related information from this object $myorder in your theme file

{$myorder->total_paid}

{$myorder->total_shipping}

{$myorder->id}

You can look into following file to see what fields are available to use

 

/classes/order/Order.php

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...