Moving script to an external file???

Automatic multi currency display on entire catalog.

Run your catalog in a main currency (or a main and alternate) with the customer having the option to turn on an additional currency throughout the Catalog, Cart and Checkout.
Post Reply
paulbeckett
Posts: 2
Joined: Sat Mar 24, 2007 6:04 pm
Contact:

Moving script to an external file???

Post by paulbeckett »

Hi Norman

Can you confirm if the following Norprice scripts, which are currently onpage, can be moved to an external file(s)...
<script type="text/javascript">
<!-- Extract and remember the US$ to UK£ rate
if ( document.cookie ) // only if cookies enabled
{
if ( document.cookie.indexOf('destcurr=') == -1 ) // cookie not set so lets set it
{
var baserate = -1;
var intialrate = -1;
var basecurrency = document.textor1.basecurrency.value; // our normal currency
var initialcurrency = document.textor1.initialcurrency.value; // our additional currency
for(var i=0; i <= 100 ;i++) // all the ISO codes
{
if ( iso == basecurrency ) baserate = curate; // look for the BASE to $ rate
if ( iso == initialcurrency ) intialrate = curate; // look for the DEST to $ rate
}
if ( (baserate > -1) && (intialrate > -1) ) // valid rate
{
document.cookie = 'destcurr=' + escape(initialcurrency + ':' + baserate + ':' + intialrate) + '; path=/'; // set the cookie
document.location.reload(); // and reload the page
}
}
}
//-->
</script>


and

<script language=JavaScript>
<!-- V1.17
var hidemain = 'GBP';
var hidealt = '';
var showonly = '';
var hidefraction = 100;
var mainsymbol = '£';
var cgiurl = 'http://80.243.178.177/cgi-bin/ca000001.pl';
function norpricepopup(){
var arg = '';
if ( arguments.length == 1 ) arg = '?' + arguments[0];
var pricewin=window.open('http://80.243.178.177/acatalog/norpricepopup.html' + arg, 'pricepop', 'height=100,width=400,toolbar=no');
pricewin.focus();
}
//-->
</script>


Paul
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Post by norman »

The first block of code: Possibly - however you've not said what page(s)this appears on so I cannot be sure.

The second block: Sort of. What you've posted is the code AFTER Actinic has expanded CUSTOMVAR's and NETQUOTEVAR's. This isn't the code that's in your Templates. You could move this to an external file but only if you change all CUSTOMVAR's and NETQUOTEVAR's to their generated values. This would, of course, prevent you from altering these values via the CUSTOMVAR's and NETQUOTEVAR's.
Norman
Post Reply