Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

What to do when basic {literal} not enough?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-25-2004, 07:42 AM
 
gardel gardel is offline
 

Member
  
Join Date: May 2004
Location: San Francisco
Posts: 20
 

Default 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
Reply With Quote
  #2  
Old 11-30-2004, 10:51 AM
 
instinctual instinctual is offline
 

eXpert
  
Join Date: Nov 2003
Posts: 247
 

Default


{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
Reply With Quote
  #3  
Old 12-01-2004, 05:45 AM
  joshf's Avatar 
joshf joshf is offline
 

Advanced Member
  
Join Date: Jul 2003
Posts: 97
 

Default

{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>
__________________
joshf | X-Cart Portfolio
Currently: http://nightowlpapergoods.com | http://pinkolive.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:30 PM.

   

 
X-Cart forums © 2001-2020