![]() |
What to do when basic {literal} not enough?
In order to track pay-per-click performance, I need to include a revised version of the following JS snippet somewhere in the order process. I assume the right file is /customer/main/order_message.tpl (if I am wrong, please correct me).
Code:
<script language="JavaScript" type="text/javascript" src="https://www.trackhelp.com/bin/ctrack.php"></script> In the script above, I have to somehow substitute {$subtotal} for ORDER_SUBTOTAL and {$order.orderid} for ORDER_NUMBER. I tried the following, and it broke the ordering process: Code:
if (typeof(valid) + '' != 'undefined') {literal}{tlitrack(3,{/literal}{$subtotal},{$order.orderid}{literal});}{/literal} I'm guessing that embedding the {literal} tag within a javascript {tag} is a no-go. Can someone offer an alternative approach? Thanks |
{literal} <script language="JavaScript" type="text/javascript" src="https://www.trackhelp.com/bin/ctrack.php"></script> <script language="JavaScript" type="text/javascript"> <!-- var siteid = 1626; var proto = 'https'; if (typeof(valid) + '' != 'undefined') {tlitrack(3,{$subtotal},{$order.orderid});} //--> </script> {/literal} I would imagine the above would work - but can't remember if "{literal}" makes smarty tags non-interpreted. I'd say the main problem you have is that {tlitrack already begins with { - so therefore trying to put your smarty variable in there will break it - 2 sets of those brackets prolly isn't good. Instinctual Colorado X-Cart Versions 3.5.x - 4.0.6 |
{rdelim} and {ldelim} should work OK in this instance:
Code:
|
All times are GMT -8. The time now is 11:21 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.