NOTE: As of 21st October 2016, this plugin is no longer available. It was removed from the WordPress plugin repository at the request of Yahoo! as they no longer allow their exchange rate API to be used. Existing users should transition to a different solution as soon as they can, as there will be no further updates to the plugin.
Shows currency values to readers in their local currency (in brackets after the original value). For example: If the site’s currency is Chinese yuan and the post contains 10 yuan, a user from Australia will see 10 yuan (AUD$1.53), while a user from US will see 10 yuan (USD$1.39).
Why Use It?
I’ve seen many bloggers write something like: 10 yuan (about $1.50) – because many of their readers don’t know how much yuan (or whatever currency they are using) is worth.
LocalCurrency automatically does this for you and tells readers exactly how much it’s worth, in their own currency, wherever they are from.
Features
- Determines the reader’s country via IP address, using IP2C
- Obtains exchange rates from Yahoo! Finance
- Uses ‘AJAX’ techniques so that converting currency values doesn’t delay page load times
- Caches exchange rates locally to minimise calls to Yahoo! Finance
- Only does something if there is a currency value in the post
- Allows visitors to change their currency via a selection box
- Gives site owner the ability to hide the original value if desired
- Gives site owner the choice of using current or historic rates (ie at time of post)
- Now works with mulitple source curriencies
Installation
- Download the plugin file and unzip it.
- Upload the localcurrency folder to the wp-content/plugins folder.
- Activate the localcurrency plugin within WordPress.
Note: The plugin is large compared to most WordPress plugins, due the IP2C database used to recognise the reader’s country
Alternatively, you can install the plugin automatically through the WordPress Admin interface by going to Plugins -> Add New and searching for LocalCurrency.
Upgrade
Please update this plugin through the WordPress Admin interface.
Usage
Enter any currency values you want converted using the localcurrency shortcode. For example:
[localcurrency]$65[/localcurrency]
This can be done manually through the Visual view in the post editor, or using the LocalCurrency Quicktag in the Code view (select the number to be converted and click the quicktag).
For a currency range, use a hyphen between values (without spaces), eg:
[localcurrency]$65-$75[/localcurrency]
There is a site-wide Site Currency setting which is used as the ‘from’ currency. To override this and convert from a different currency for a specific value, specify the ‘from’ currency (using a valid currency code):
[localcurrency from="GBP"]£65[/localcurrency]
The plugin will work with more than one currency per page, but will be much slower.
Note: This plugin used to use the following format: $10. This will still work but it is recommended to use the shortcode format shown above. Please do not use both formats on the one page.
WARNING:
The plugin strips non numeric characters (such as $) from between the tags, before converting the value. However, some currency symbols may include numeric characters. For example, 10元 may be stored as 10元. The 20803 will remain after the non numeric characters are stripped and will be considered as part of the value to convert, resulting in an incorrect value.
If you experience this problem, please leave the currency sign outside the tags (ie: 元[localcurrency]10[/localcurrency]).
See LocalCurrency In Action
The following sentence should contain the amount in your local currency:
I spent 20 yuan on dinner last night, then 30 yuan on the taxi home.
If you want to change the currency, use the selection box at the bottom of the post. Note: if you are in China, you will not see anything.
Support
This plugin is officially not supported (due to my time constraints), but if you post on the WordPress.org forum for this plugin, I should be able to help.
Disclaimer
This plugin is released under the GPL licence.
I do not accept any responsibility for any damages or losses, direct or indirect, that may arise from using the plugin or these instructions. This software is provided as is, with absolutely no warranty. Please refer to the full version of the GPL license for more information.
Acknowledgements
This plugin makes use of some code from the CurreX plugin. Thanks to miCRoSCoPiC^eaRthLinG.
It also uses IP2C and Yahoo! Finance.