E-Junkie Forum http://www.e-junkie.com/bb/ E-Junkie Forum RSS en-us Copyright 2009, 19.5 Degrees. All rights reserved. webmaster@e-junkie.com webmaster@e-junkie.com Wed, 28 Jan 2009 10:19:47 GMT Sat, 21 Nov 2009 11:45:58 GMT 681 E-JUNKIE 5 E-Junkie Forum http://www.e-junkie.com/bb/ http://www.e-junkie.com/ej/logo.gif 290 104 Post #4 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 Wed, 28 Jan 2009 10:19:47 GMT E-junkie Discussions; brynmyrddinemrys Post #3 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 Wed, 28 Jan 2009 07:31:49 GMT
The only parsing E-junkie does to your code before publishing it is to replace "template variables" with their respective values.

So, you code should be -

<script type="text/javascript">
var gross = "[%total%]";
if (gross==null)
{document.write("<b>OUTPUT 1</b>")}
else
{document.write("<b>OUTPUT2</b>")}
</script>

PS: I am assuming your are using this code on "common" thank you page.

For the complete list of template variables that you can use in the thank you page, please see http://www.e-junkie.com/ej/help.customization.htm]]>
E-junkie Discussions; E-junkieChef
Post #2 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 Wed, 28 Jan 2009 05:54:08 GMT
<script type="text/javascript">
var gross = "<?php print $_GET['mc_gross']; ?>";
if (gross==null)
{document.write("<b>OUTPUT 1</b>")}
else
{document.write("<b>OUTPUT2</b>")}
</script>

The php print function is not returning any variables...]]>
E-junkie Discussions; brynmyrddinemrys
Post #1 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 http://www.e-junkie.com/bb/topic/3122/pg/0#post8917 Wed, 28 Jan 2009 03:19:22 GMT
I am trying to incorporate logical if-then statements to create a thank you page that reports a well-formatted customized invoice, reporting only the data applicable to each customer's purchase. In other words, the invoice for a free file download does not need to report the price or shipping address, whereas the invoice for a tangible good would report all this information.

I am more familiar with javascript, so I wrote myself a code in javascript to trigger events on the thank you page, based upon the order data - but I cannot seem to figure out how to get my javascript code to recognize this order data... here's a sample of my logic:

<script>
var gross = document.getElementById(gross);
if (gross==null)
{document.write("<b>FREE DOWNLOAD</b>")}
else
{document.write("<b>ORDER DETAILS</b>")}
</script>

of course, this doesn't work because I totally just pulled that .getElementById command out of the air... but I am beginning to wonder whether this kind of thing is possible using javascript or whether I will have to try php instead. or maybe I am just missing something simple.]]>
E-junkie Discussions; brynmyrddinemrys