I am a fairly inexperienced, renegade programmer and know only the basics of javascript and php, so this may be a simple question...
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.