Hi all
Can any javascript gurus out there offer some help with the following please?
We are trying to display the dollar and euro price of the shopping cart total (which is in GBP) on the shopping cart page.
But it doesn't work. The position on the page where the dollar and euro amounts should appear is blank.
Here is how we are trying to do it:
In Act_ShoppingCartXML.html we have placed the following:
<script language=JavaScript>
<!--
var OrderTotal = 'NETQUOTEVAR:TOTAL';
// -->
</script>
This enables the NQV:TOTAL to work in the next template (Act_ShoppingCart.html) which is where we intend to convert the cart total and display it, as a variable called 'OrderTotal'.
Then in Act_ShoppingCart.html we have placed the following two bits of code where we want the dollar and euro prices to appear.
<script language=JavaScript>
<!--
Dollars("OrderTotal");
// -->
</script>
<script language=JavaScript>
<!--
Euros("OrderTotal");
// -->
</script>
In the Primary template we have added a couple of lines to include two javascript files:
<SCRIPT LANGUAGE="JavaScript" SRC="exchange_rates.js" TYPE="text/javascript"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="currency.js" TYPE="text/javascript"></SCRIPT>
The first JS file contains two lines to define the exchange rates to be used:
var dollarrate = 1.4;
var eurorate = 0.86;
The second JS file is what does all the work and I think that the problem is in this file.
I have attached currency.js to this thread as a txt file.
My knowledge of javscript is rather lacking and I'm unable to work out why it does not work. Can anyone out there offer any advice?
Thanks
Nick
Can any javascript gurus out there offer some help with the following please?
We are trying to display the dollar and euro price of the shopping cart total (which is in GBP) on the shopping cart page.
But it doesn't work. The position on the page where the dollar and euro amounts should appear is blank.
Here is how we are trying to do it:
In Act_ShoppingCartXML.html we have placed the following:
<script language=JavaScript>
<!--
var OrderTotal = 'NETQUOTEVAR:TOTAL';
// -->
</script>
This enables the NQV:TOTAL to work in the next template (Act_ShoppingCart.html) which is where we intend to convert the cart total and display it, as a variable called 'OrderTotal'.
Then in Act_ShoppingCart.html we have placed the following two bits of code where we want the dollar and euro prices to appear.
<script language=JavaScript>
<!--
Dollars("OrderTotal");
// -->
</script>
<script language=JavaScript>
<!--
Euros("OrderTotal");
// -->
</script>
In the Primary template we have added a couple of lines to include two javascript files:
<SCRIPT LANGUAGE="JavaScript" SRC="exchange_rates.js" TYPE="text/javascript"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="currency.js" TYPE="text/javascript"></SCRIPT>
The first JS file contains two lines to define the exchange rates to be used:
var dollarrate = 1.4;
var eurorate = 0.86;
The second JS file is what does all the work and I think that the problem is in this file.
I have attached currency.js to this thread as a txt file.
My knowledge of javscript is rather lacking and I'm unable to work out why it does not work. Can anyone out there offer any advice?
Thanks
Nick
Comment