View Full Version : Exchange rates
mcottam
16-Jan-2003, 01:32 PM
Hi
Is there a way to keep prices linked to an exchange rate. For example displaying prices GBP as the base price and also showing the price in EURO's. But having the EURO linked to the current GBP to EURO exchange rate.
I hope this makes sense.
Thanks
Menar
17-Jan-2003, 09:32 AM
This cannot be done as a feature in Actinic, however I recommend you look at the following thread:
http://community.actinic.com/showthread.php?s=&threadid=234,
who is one of our client who has built a plug-in for that particular function, it is currently being tested in V5. You may want to contact the client for further information and availability for V6.
harlequin
19-Jan-2003, 01:17 PM
Hi There, below is a method we use and is described in Advanced User Guide version 5 but has been modified a little to suit our purposes.
The method Menar points to above is very good if you have a Payment Service Provider such as Worldpay and want to get the exact exchange rate your client will actually get charged.
This method is simply to provide a guideline to your customers.
If you are not familliar with editing your templates, contact us off the forum and we will have a quick chat about it, it isnt anything to worry about providing you take some simple precautions like backing up anything before you edit it.
If you open Act_ProductPrice.html and find the code:
NETQUOTEVAR:TAXMESSAGE</span>
(the </span> part will not be there if you are not using CSS)
immediately after it add this:
<br>
<font size="1"><em>Convert into</em> <A HREF="javascript:CurrencyPopup('Amount=NETQUOTEVAR:COST&From=GBP&To=EUR')"></A><A HREF="javascript:CurrencyPopup('Amount=NETQUOTEVAR:COST&From=GBP&To=EUR')">Euros</A>
| <A HREF="javascript:CurrencyPopup('Amount=NETQUOTEVAR:COST&From=GBP&To=USD')">US
Dollars</A> | <A HREF="javascript:CurrencyPopup('Amount=NETQUOTEVAR:COST&From=GBP')">Other</A></font>
<font size="1"> (NOTE: To be used as a guideline only)</font>
you will then need to open Act_Primary.html or Act_PrimaryLeft.html (if you are using left aligned pages) and almost at the top where you see the tag:
</head>
paste this directly BEFORE it:
<SCRIPT language="JavaScript">
function CurrencyPopup(QueryString)
{
CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,height=170,width=600')
CurrencyWindow.focus()
CurrencyWindow.location.href = 'http://www.xe.net/ecc/input.cgi?Template=sw&'+QueryString
}
</SCRIPT>
http://www.musiccorner.co.uk/acatalog/LCM_Keyboard_Music.html is an example of what you will get....
I hope this helps as it saves you uploading all your html pages every time the exchange rate changes, saves you worrying about keeping it up to date, and also makes it far better than just linking to the currency exchange where your clients then have to manually input the price, currency to convert from, and currency to convert to...
Tested in Actinic 4,5, and 6.
PLEASE NOTE IF YOU HAVE ALREADY PREVIOUSLY COPIED THIS CODE IT HAD A SLIGHT ERROR IN IT WHICH HAS BEEN EDITED NOW.
murf
20-Jan-2003, 09:59 AM
We have Jan's currency mole and it works like a dream.
regards
mike
harlequin
20-Jan-2003, 02:17 PM
I am going to try the mole for a couple of our clients however i would like to see (for example) some code that was inserted in the price template that called the conversion in realtime on the server, maybe by referencing a conversion sums file uploaded once a day and then parsed with xml to produce realtime conversions.
This would avoid a lengthy upload for some people with lots of html pages and would be far more efficient.
what do you think jan if you see this...
Hi Steve,
I think that there are two things to achieve with dual currencies, 1 is keeping in line with your PSP so that the customer sees the same price throughout their transaction (v. important IMHO), the other is keeping the currency up to date.
It would be far more efficient to keep say a file up to date on the server with the current conversion rate and have the HTML files access that because you avoid the uploads. You could create the file with a program on either the server or the PC and update it at scheduled intervals. Could you combine this with your script above to achieve what you want to do. You don't need a mole to do that because their is no interaction with catalog.
I was talking to someone the other day who did clever things with NETQUOTEVARs you can apparently 'run' them rather than display them and they used this feature to implement stock levels on the web site, maybe you could do something like that.
Regards,
NormanRouxel
20-Jan-2003, 06:13 PM
In case anyone's interested in what Jan means by 'Running' an NETQUOTEVAR consider this.
You can refer to ahe same NETQUOTEVAR more than once in the template it's active in. So in Act_ProductPrice.html below:-
<!-- ProductPrice HTML begin -->
<!-- This template is used for the product price text. -->
<br><span class="actxsmall"><b><Actinic:RETAIL_PRICE_TEXT>NETQUOTEVAR:PRICEPROMPT</Actinic:RETAIL_PRICE_TEXT> NETQUOTEVAR:DISCOUNT_QUANTITY NETQUOTEVAR:COST</b></span><span class="actxxsmall">NETQUOTEVAR:TAXMESSAGE</span>
<!-- This template is used for the product price text. -->
<!-- ProductPrice HTML end -->
You could add an extra reference like this:-
<!-- ProductPrice HTML begin -->
<!-- This template is used for the product price text. -->
<br><span class="actxsmall"><b><Actinic:RETAIL_PRICE_TEXT>NETQUOTEVAR:PRICEPROMPT</Actinic:RETAIL_PRICE_TEXT> NETQUOTEVAR:DISCOUNT_QUANTITY NETQUOTEVAR:COST</b>
<script language=JavScript>DoSomething('NETQUOTEVAR:COST')</script>
</span><span class="actxxsmall">NETQUOTEVAR:TAXMESSAGE</span>
<!-- This template is used for the product price text. -->
<!-- ProductPrice HTML end -->
And somewhere else (like in ActinicCore.js you have the DoSomething routine that does whatever you want:-
function DoSomething(InputValue){
alert(InputValue)
}
There's a real world example of this in the archives somewhere (I did one and then found that there was already one there) regarding passing the cost to a routine which strips out the text around the number and then converts it to several countries currencies and document.writes that back to the page. Thus extending the number of currencies on display from the Actinic maximum of 2.
harlequin
21-Jan-2003, 01:42 AM
The javascript is beyond me at the moment, I simply took a method in the Advanced User Guide and tweaked it.
Maybe Jan could alter her Mole to still retrieve the current conversion rates from the PSP and upload the data to the server working in conjunction with (PLEASE) another plugin from the Maestro himself (thats you Norman) that converts and doc.writes the updated conversions.
I love it when a plan comes together :D
paulh69
21-Jan-2003, 04:21 AM
i'd imagine you'd grab exchange rates from your psp
http://www.securetrading.com/download/currencyrates/curr-gbp-ns-today.txt
have some program convert this
NatwestG
ABCDEFG
20030121
20030121
20030121
GBP
14
AUD 0000027669028
CAD 0000025118526
CHF 0000022418422
DKK 0000113804539
EUR 0000015390220
GBP 0000010000000
HKD 0000127414388
JPY 0001925200629
NOK 0000111872662
PLN 0000062359261
SEK 0000140910422
SGD 0000028303009
USD 0000016340415
ZAR 0000144425563
to your currency.js javascript include file:
(for each of the currencies you will be using)
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function aud(number) {
number = '' + number;
var aud = 2.7669028;
var output = ('aud' + number * aud);
return (output);
}
function usd(number) {
number = '' + number;
var usd = 1.6340415;
var output = ('$' + number * usd);
return (output);
}
function eur(number) {
number = '' + number;
var eur = 1.5390220;
var output = ('€' + number * eur);
return (output);
}
// End -->
</script>
then put something like this in your template
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write(eur(42.62)+' '+aud(42.62)+' '+usd(42.62)+'<BR>');
// End -->
</script>
where example amount 42.62 can be replaced by NETQUOTEVAR:COST
just needs some rounding and formatting...
GBP £42.62 EUR€65.59311763999999 AUD$117.92539733599999 USD$69.64284873
Regards,
Paul
Originally posted by harlequin
Maybe Jan could alter her Mole to still retrieve the current conversion rates from the PSP and upload the data to the server working in conjunction with (PLEASE) another plugin from the Maestro himself (thats you Norman) that converts and doc.writes the updated conversions.
Well I still don't think that a Mole is needed here, they are used to automate catalog and this rather clever idea bypasses catalog's dual currency facilities.
I think that it would work better if the currency rates were stored on the server (in the case where you want to stay in line with a PSP that is) because it must take time to go and collect the rates as the prices are displayed so it must slow the site down to do it in this way. If you agree then what you need is a timed process to collect the currency rates and put them onto the website in a file, the javascript could then be altered to use this file instead of the remote currency server to collect the currencies. The other nice thing about these solutions are that you can have lots of currencies displayed if you wish to.
Regards,
Jan.
paulh69
21-Jan-2003, 11:59 PM
using java script certainly works - the hardest part looks to be the server script to grab the days exchange rates from the various psp's, validate it and make the currency java script for the website
since the javascript is changing the page on the fly it should also be possible to detect the users browser country/currency and use that to guess their own currency (even turn it off for uk?) and update prices in drop down lists
would be helpful and save code if actinic didn't use encoded html for the NETQUOTEVAR:COST !
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.