Currency Converter Script?

Hi,

I am interested in a currency converter script which changes the prices on website when selected currency on a drop down menu. Anyone know if any script exists?

Thank you!

Here is an API that allows you to do this.
Automatic Currency Conversion

Anything simplier and with an example?

Thanks!

This site is good, with multiple conversions;

XE - Universal Currency Converter

Did you just post that to get a link here? Please read what I stated I wanted.

Thanks!

This explains how to start with example code;
Creating a Simple Currency Converter with Automatic Symbols - TalkPHP
This is also simple;
USD,Dollars,EUR,Euro,JPY,Yen,GBP,Pounds,Exchange Rates,Currency Rates,Simple Currency Converter

Thanks, a little complex looking for a simple script already made.

The PHP file that’s attached on to the Creating a Simple Currency Converter with Automatic Symbols article seems to be already made and working.

The currency conversion assumes that your base prices are in GBP, so to show 50 GBP as USD you would use the following command:


echo get_currency(50, CURRENCY_USD);

If nobody knows of anything simpler, you might just have the simplest that there is.

Just in case it helps though, can you expand more on how simple you require it to be?

Looking for one already made if ones out there.

Thanks!

Tried it http://www.1tm.com/currency.php shows “0.00” thats it nothing else.

Thanks!

Then you may have to fix how your server is configured to respond to the setlocale command, or fake it.

Anywhere that shows you how to load this? And does this script have a drop down option where you can select currency and it will change all the prices on the site?

Thanks!

The setlocale command works differently depending on which platform the PHP server is on.

The script doesn’t provide more than what there is, but it’s a bases from which you build up on. There no point in doing so though until the actual conversion works for you.

Get the conversion working first. The rest can be dealt with when you have a conversion solution that works.

The tricky thing about this type of conversion is that it isn’t constant, so it needs to reference some database somewhere.

The conversion between GBP to Dollar may be 0.867 (just an example), but it may be 1.234 in six month (if it were people would do backflips, but again, just an example).

Be sure to keep this in mind when researching these or you could run into a serious oops down the road.

That is why resources such as Automatic Currency Conversion are a god-send, so that you can regularly retrieve the latest rates and store them somewhere, if it it’s low volume, get the conversion on an as-needed basis.

To change all prices on your site you’ll need to put the code in place to do this.

Just do a conversion sample with the API to work out the current rate of exchange and then apply this rate to all the prices on your site.

So for example say you were displying in $ and the user wanted €, youd query the API with 1$ and get back €0.715 save this value as a coeffiecient and then multiply all your prices by the coeffiecient.

Hey Paul

Thats a great API, thanks for posting.

I do a few estate agency sites that us this feature, when I looked (about 3 years ago) I didnt find any service that gave this functionality so Ive been scraping a site to get currency rates and making my own database, but this beats that hands down :slight_smile:

Thanks again Im off to get a key :cool: