Page 1 of 1

Variables available for javascript...

Posted: Thu Oct 23, 2008 2:09 pm
by mxr64k
Hi everyone... I'm a newb to AbleCommerce so please bear with me..

My client is having problems getting a hit counter working on one of the pages: Receipt Page

We have placed the correct javascript code in the Content section (Admin | Website | Content and Layout | Edit Scriptlet)

It is rendered on the page correctly and is picked up by our hit counter host.

My problem is we need to send the OrderID and Total Charges values in our code...

Basically what we have is:

document.write('<IMG src="https://hitcounterhost/' +
'confirmation.asp?acct=testaccount' +
'&type=125147' +
'&s=214'+
'&uniqueId=' + ordId +
'&orderAmount=' + orderAmt + '"' +
' height=1 width=1 border=0>');

I need to populate ordID and orderAmt.... how can I do that?

Thanks for your help!
Todd

Re: Variables available for javascript...

Posted: Fri Oct 24, 2008 5:05 am
by mazhar
You need to write some server side code that dynamically build this javascript then inject the created javascript in the page. There is a good example in the application take a look at the ConLib/GoogleAnalyticsWidget control.