PDA

View Full Version : Variable not displaying.


Jake Herbert
07-02-08, 01:40 PM
Hi,

I am having a hard time passing a variable for google analtics on my INVC page.

Here is a snap shot of the code I am using to pass the order totals.

<textarea id="utmtrans">
UTM:T|&mvt:order:id;|mainstore|&mvt:order:total;|<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'TAX'">&mvt:charge:amount;|</mvt:if></mvt:foreach>
<mvt:foreach iterator="charge" array="order:charges"><mvt:if expr="l.settings:charge:type EQ 'SHIPPING'">&mvt:charge:amount;|</mvt:if></mvt:foreach>

This passes the shipping charges and taxes correctly, but the page output includes "&mvt:order:id;" and "&mvt:order:total;" instead of the actual value.

Output of this on the INVC page is

<textarea id="utmtrans">
UTM:T|&mvt:order:id;|mainstore|&mvt:order:total;|1.183|
5.06Somehow it is not showing the variable, the weird thing is that I use &mvt:order:id; earlier on in the INVC page and it correctly shows the order value.

Can any one help me?

Many Thanks

Jake Herbert
www.facewest.co.uk

Jake Herbert
07-02-08, 01:43 PM
Addition to above-

Why has it replaced all the "o" with the face symbol in my above post?

Something tells me this has something to do with my problem!!

Any ideas?

leslienord
07-02-08, 01:54 PM
What's happened is you need to either use the CODE tag when posting snippets of code or disable smilies. I've turned them off in the post for you.

Bruce - PhosphorMedia
07-02-08, 06:50 PM
A variable expression, such as &mvt:order:id;
gets "encoded" when placed in text area since a text area is intended to display and enter "plain" text. If you placed those variables in something like the src parameter of an image tag, they should show up just fine (when the page source is viewed). That's what most tracking systems use anyway.

Jake Herbert
07-03-08, 10:24 AM
Thank you. Now fixed.

All I needed to do was change

&mvt:Order:total;

To

<mvt:if expr="NOT ISNULL l.settings:Order:total">&mvt:order:total;</mvt:if>

Then it displays correctly. Seems a bit wierd, but I see what you mean about the Text area.

Works fine now, can't wait to see my analytics data.

Regards

Jake Herbert