X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   What to do when basic {literal} not enough? (https://forum.x-cart.com/showthread.php?t=10570)

gardel 11-25-2004 07:42 AM

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>
<script language="JavaScript" type="text/javascript">
<!--
var siteid = 1626; var proto = 'https';
if (typeof(valid) + '' != 'undefined') {tlitrack(3,ORDER_SUBTOTAL,ORDER_NUMBER);}
//-->
</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

instinctual 11-30-2004 10:51 AM


{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

joshf 12-01-2004 05:45 AM

{rdelim} and {ldelim} should work OK in this instance:

Code:


<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') {ldelim}tlitrack(3,{$subtotal},{$order.orderid});{rdelim}
//-->
</script>



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.