ajensen27 Posted April 1, 2016 Share Posted April 1, 2016 Hello, Can someone please help with what the global variables are for the following so that I can insert it into a few different tracking codes I use? Customer First Name Customer Last Name Customer Email Order ID Order Amount And if the code is using <script> tags to I have to put the script in between {literal} tags? If I have 3 different sets of conversion code, can I put the {literal} tag before the first one and then the closed {/literal} tag after the last closing script tag? Thanks!! Alex Link to comment Share on other sites More sharing options...
rocky Posted September 23, 2016 Share Posted September 23, 2016 You can use $cookie->customer_firstname for the first name, $cookie->customer_lastname for the last name and $cookie->email for the email address in any TPL file. The cookie doesn't contain the order ID and amount though. If you're placing the script code in order-confirmation.tpl, you can use the variable {$id_order} to get the order ID. Getting the order amount is harder, since there's no Smarty variable with that value. You'd have to override the OrderConfirmationController::initContent() function and add code like the following: $order = new Order((int)$this->id_order); $this->context->smarty->assign('order_total', $order->getTotalProductsWithTaxes()); Then you can use {$order_total} in order-confirmation.tpl. 1 Link to comment Share on other sites More sharing options...
ajensen27 Posted September 23, 2016 Author Share Posted September 23, 2016 Thanks Rocky! I actually noticed a variable in order confirmation controller for the order amount, {$order->total_paid}. Only thing is that it shows 6 decimal points. Can you show me how I can round this variable down to 2 decimal points? Thanks again! Alex Link to comment Share on other sites More sharing options...
rocky Posted September 23, 2016 Share Posted September 23, 2016 Try: {$order->total_paid|number_format:2} 1 Link to comment Share on other sites More sharing options...
ajensen27 Posted September 27, 2016 Author Share Posted September 27, 2016 That did the trick. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now