| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How do I reference an Order Total on order_message.tpl? | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Im installing some tracking code that will be executed on order_message.tpl (once the order is confirmed.) I need to reference three types of information on this page for the tracking code.. one most importantly..
I need to reference: - Order Total (Grand Total after shipping+taxes+etc) (most important one) - Order Qty (Total # of items purchased) - Order ID (ID of that specific Order) I have no idea the names of these variables.. I will have no problems referencing them, I just need to know what the names are of the variables that hold these values. I remember awhile back someone had posted a snippet of code to display all current variables and their values on a page.. but I dont remember that, so if you could provide the variable names (that I can reference from skin1/customer/main/order_message.tpl) or the code to display all the variables, and I can figure that out myself. Thanks!
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
#2
|
|||||||
|
|||||||
![]() func_print_r($GLOBALS);
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() Wonderful, thank you.
I was able to find that I could print the variables I needed most with: Order Total: {php}echo $this->_tpl_vars['orders']['0']['order']['total'];{/php} and Order ID: {php}echo $this->HTTP_GET_VARS['orderids'];{/php} However, I need to set a Javascript variable to the values of those two.. How can I reference those varaibles, when the Javascript is wrapped in {literal}.. considering you cant put {php} inside of {literal}.. I know I could use PHP to include a .js file with this information, and then use a str_replace (a PHP function) to replace the parts of the file where I need to input those values.. but Im hoping theres a more proper way of doing this (referencing a PHP value inside of {literal}.. maybe set a smarty variable from the PHP variable values, and then reference the smarty variable inside of {literal}? Not sure how I would do this either.. and it only only work if {php} was parsed before completely before Smarty because I would still have to wrap the echo'd text in {literal}..)
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
#4
|
|||||||
|
|||||||
![]() I was able to achieve the desires results by not using {literal} around the Javascript code, and replacing the { in the javascript code with {ldelim} and the } in the javascript code with {rdelim}, allowing me to reference {php} and the smarty variables unliterally.
__________________
Jeremy Freeman EZWatch Store X-Cart v4.1.5 |
|||||||
|
|||
X-Cart forums © 2001-2020
|