WordPress Plugin – LocalCurrency

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&amp#20803;. 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.

122 Responses

  1. Pingback: WordPress Plugins Database » Plugin Details » LocalCurrency

  2. Pingback: Wp Wordpress » Blog Archive » LocalCurrency

  3. Nice work on the plugin, Stephen. Leave the plugin – the whole idea itself is brilliant and I’m sure this plugin will receive a wide audience the moment people realize it’s true potential.

    You may want to release the the code as a non-plugin version too, as the usefulness of this beauty far transcends that of a simple wordpress plugin. This one can find wide deployment across various financial / property sites…

    Cheers,
    m^e

  4. miCRoSCoPiC^eaRthLinG,

    Thanks! Good idea – when I get time, I’ll write up how to do this outside of WordPress. I’ll do that at my other site, More Than Scratch The Surface.

    Thanks again for the curreX plugin, without which, LocalCurrency wouldn’t have been possible (at least it would have been much harder!).

  5. I’ve now released a new version 1.01, fixing two problems:

    1. The plugin didn’t work if there was only one currency on the page. This was because of the way the JavaScript array was dynamically created by PHP (it didn’t cater for arrays with only one value, which need to be created differently). Now fixed.

    2. The plugin didn’t work properly on the home page (and other pages with more than one post). I’ve fixed it so it now works, but note: if you change the currency, it will only change currency values in the post you changed it from. It will not change other posts on the page. I may add this future, so changing one post will change all (I got this working, but it was not stable and needs further investigation, so I left it out for now).

    The new version can be download above.

  6. Howdy

    Great plugin, I’ve been looking for somehting like this. I have a whisky site where I add the cost of whisky bottles by Custom fields. I then add this info to the post but not wiithin the loop. Does this work outside the loop?

  7. Hi Jens,

    At the moment it won’t work with Custom fields as they aren’t actually part of the post body. It may be possible to modify it so that it filters the custom fields instead, but I’d need to find out more about how you use the custom fields (is there only one for each post, or are there several, what are their names, etc).

    If you could send me some more details in an email, I’ll have a look into it. If I can do a quick hack, I will – although if it’s a lot of work, I won’t have time now.

  8. Hi,

    Great plugin. See it in action on http://theshop.free-jazz.net which runs on WordPress_MU …

    A question: is there any development still going on? If so, are there plans for a widget as alternative to the current select box ?

    Anyway, thanks ! 🙂

  9. Hi Stephen, great plugin, thanks for working on it.

    But I have a problem with it that might be a bug, for some reason, it’s not converting the values on my blog, it just displays “NaN” where the converted value should be. I can see it working on your post, but it’s not doing it for me.

  10. Hi RavanH,

    I’m open to further developing this plugin, although my time is pretty limited over the next few months.

    If you’re after a widget to enter a value and have it converted to the currency of your choice, try the CurreX plugin.

    If you’re after something else, give me some more details and I’ll see if I can do anything.

  11. Hi Juan,

    I’ve been to your site and seen the problem. It’s a bit puzzling, because it works on my site, but not yours, so it seems to be something to do with the server.

    Anyway, I’ve been through the code, narrowing down where the problem may be. It seems almost certain that it’s related to the server side script that contacts Yahoo! Finance and gets the exchange rate.

    The NaN stands for Not A Number. I suspect that the server side script isn’t returning the exchange rate. To confirm this, I really need to see what is being returned by the script. The only way to do this, would be for me to send you a new plugin file, which has a JavaScript alert which pops up with the value.

    You obviously won’t want to leave this in place (users will keep getting pop up messages with the value!), but if you could put it in for a brief time, note what it says, then put the old plugin file back, that would give me some key information to look into it further.

    Let me know if you’re willing to try this and I’ll send you the modified plugin file as soon as I can. Thank you.

  12. I’m open to try that, if it helps you inprove your plugin, I would be happy to help.

    Besides I installed this plugin because of the excelent service it provides, so the proper thing to do is help it improve and make it work for me.

  13. Hi Juan,

    Thank you for having a great attitude – not everyone is so helpful! Plugin authors such as myself really appreciate it when some is willing to help sort out problems.

    I’ll email you a new localcurrency.php shortly. I’ve actually done it a little nicer than I said in my previous comment. I’ve added a debug mode option to the Options page, so you can turn the debug mode on and off as you need. Also, it should only affect users who are logged in (at level 9 or above), so your readers won’t notice a thing.

    Once you get the new file, simply ftp it up to the wp-content/plugins/localcurrency folder on your server (overwriting the previous file). There’s no need to put back the original afterwards, you can leave the new file there.

    Then go to the Options -> Local Currency page and turn on debug mode and Save the option. Go to a post where there are values to be converted and some messages should pop up. If you could make a note of them and email me back, it should help me work out where the problem lies. Then you can turn debug mode off.

  14. Hi Stephen,

    Let me explain more: I am thinking of the Currency selection box that will appear at the bottom of the page/post. Would it not be nice to make it possible to place it anywhere in the sidebar through a widget?

    Again, already a SMART plugin !

  15. RavanH,

    Okay, I understand now. It would be possible to do, but there is one major problem for this: The selection box (and all the required JavaScript) only appears on posts which have a currency to convert.

    The widget would have to only appear when there was something to convert too. That’s possible – the only worry is not having a space show instead.

    I’ll put this on the list of things to look into further, but with my current workload, it may be a while before I get to it.

  16. Hello Stephen, please remember to send me the new plugin file, let’s see if it works now. 🙂

  17. Hi Juan,

    Whoops, some problem with email I guess… I emailed the file on March 13 to the email address you left with your comment. I’ll try sending it again. Please let me know if you don’t get.

    If you can let me know what numbers it pops up with it, I may be able to work out what the problem is. Thanks!

  18. Hi Stephen, let me know if you’ve got the email with the results of the test.
    Good luck.

  19. A new feature that I’d very much like to see is the ability to specify a variant source currency. I often have to write the prices of various bits of shareware into my blog so I have set US dollars as the “default” (even though I’m in Australia) – but some shareware is priced in euros. I would love to be able to vary the LC tags perhaps to something like this:
    <!-- LCSTART CURR=EU-->5<!-- LCEND-->
    Using the 2-letter country codes (or whatever Yahoo Finance uses? I only ever need 4-5 currencies so having to look up the code wouldn’t be a problem) to indicate to LC that the currency isn’t whatever the specified default is.

    My blog’s http://atmac.org/ – I’m working on upgrades so your plugin isn’t live where you can see it yet, but I have it worked into the upgrades and it’s very helpful. Thank you very much for providing it :).

    – Ricky

  20. Hi
    I’ve been looking for something like this for a long time. I’m just glad I’ve been brought to this page as I was looking for some WP plugins. Thank you so much for such excellent work. Will let you know how it works on my site. Best regards.
    … just noticed this real-time preview display of this post. Wow, you’re great. Thanks so much.

  21. Just a follow-up question. I noticed that the converted symbol used for Philippine Pesos is PHPPhp. It is redundant since we only use PhP (Ph for Philippines, and P for Peso). Is there any way we can adjust/configure this so that we only show PhP? Thanks again for such wonderful work.

  22. Pingback: WordPress 2.7 And My WordPress Plugins | More Than Scratch The Surface

  23. Pingback: The Best WordPress Plugins For Travel Blogs | Spot Cool Stuff: Websites

  24. Pingback: WordPress Plugin - LocalCurrency - WP Plugin Archive

  25. Pingback: Where Have All The WordPress Plugin Lists Gone? | More Than Scratch The Surface

  26. Ryan

    Hey

    I considered making my own plugin for this need but thought I would use an existing one and so far this is the only found. So thanks for this I’ll donate when I can.

    Ryan
    http://www.webtechglobal.co.uk

  27. Simon

    It doesn’t work in WordPress 2.8.3.
    The short tag is not parsed.

  28. Hi Simon,

    This blog is running WordPress 2.8.4 and it’s working for me – see the “See LocalCurrency In Action” section above.

    If the code isn’t being parsed, the most likely cause is another plugin filtering the content of the post / page before LocalCurrency get’s it. Can you give me some more details what other plugins you’re running?

  29. Yatin

    hi there, no doubt a nice piece of work. Is it possible for user to select which currency they want to see all values? I see that on your website its working. are you adding it in next release?

  30. As I’ve been writing a travelogue several years now, it would be helpful to lock in a currency price conversion for that specific post date, as opposed to using the today’s valuation when the post is read months or years down the road.

    Cheers

  31. Bob

    Hi Stephen,

    Just stumbled across this and I think the idea is BRILLIANT.

    Not many comments these days and still same version. You still keeping tabs on your plugin?

    I have a question: Is it possible to have the plugin do the conversion and NOT show the base price, just the converted price? A 1.0.2 with that would be a HUGE help.

    I have price tables like the one at the bottom of this page:
    http://divinginstructortrianing.com/internships/instructor.asp

    This site is being converted to WP and when it is, I’d like to show the price tables in the converted currency. But, as you see, space in the table is limited, so I don’t really want to cram 2 prices in each cell.

    Also, the just-above comment about letting the user choose a currency would be Fab.

    If you could help me out, I’d certainly Paypal you some thanks!

    Bob

  32. Bob

    Hi there,

    Sorry, misplaced your e-mail address.

    Just wondering if you had an opportunity to work on the plugin updates as per your last reply to me. We’re ready to launch the site next week and while the real-time conversion is not required, it would be nice to have soon.

  33. Hi Bob,

    I’m on it now and I’m giving the plugin an overhaul while I’m at it. I know a lot more about writing WordPress plugins now than I did two and a half years ago! Should hopefully be ready mid next week.

  34. Hi Craig,

    I was just about to add this to the plugin, when I realised it’s not really feasible. I understand the need (I have some old post that are losing their meaning because of changes in exchange rates), but…

    That would mean we’d have to store all 140-odd currencies for each post. ie If someone from France lands on your 5 year old post, you need to know the Euro rate from 5 years ago. If the next visitor is from Singapore, you need to know the Singapore dollar rate from 5 years ago (and so on).

    Storing 140 currencies isn’t a big deal in it’s own right, but contacting Yahoo 140 times in a short space of time, could be. I’ll see what I can come up with, but it may this can’t be included.

  35. Bob

    Sounds wonderful. Really looking forward to seeing what you come up with.

  36. I might have found the way to do this, but no promises as it looks like a complete rewrite… I’ll investigated over the next few days

  37. Just a quick update – it probably won’t be finished until next week. I’ve rewritten a lot of it to make it more efficient and secure.

    I’ll also be putting it in the official plugin directory, so when the update is made, you should receive a notification from the Plugins page in the WordPress and be able to automatically update as you can with other plugins.

  38. Hi All,

    The new update is out and you’ll soon see notification of an update being available in the WordPress Admin area.

    It’s added both Historical Exchange Rates and Hide Original Prices. It *should* be self explanatory from the Settings page, but let me know if you have any questions.

    I didn’t get to adding the ability to specifiy a different source currency (for cases where one price is in one currency and another is in a different currency). I may get to that in the future.

  39. Bob

    Stephen, you’re awesome. Going to DL and check it out in the next 24 hours. Get back to you with feedback.

  40. Bob

    Hi Stephen,

    Trying to deploy the plugin and have run into a couple problems.

    1) If you use the options to hide the original price AND do not display historical rates (meaning you want the default current rates by UNchecking the box in the admin) ALL the base prices disappear from the page.

    Example:
    http://divinginstructortraining.com/pattaya-thailand/living-costs-expenses/

    On my site, THB (Thai Baht) is the base currency.
    I’ve entered all the prices on this page in baht and chosen to hide the original, so that when a Brit sees the page, he sees only pounds.

    HOWEVER, here in Thailand, I don’t see ANY prices. Which is bad.

    If I check “show historical rates” the baht prices do show.

    Second — This one may not be your fault or anything you can do anything about.

    At the bottom of this page:
    http://divinginstructortraining.com/internships/padi-instructor-complete/

    is a price table. To better manage tables in WP, I’m using WP-Table-Reloaded plugin. I put all the code and rates in the back end then insert a shortcode where I want the table to appear.

    The table here DOES have the LCSTART and LCEND tags in each cell. But no conversion is occurring and no link/currency menu/etc. is being shown. The plugin is not loaded on this page.

    I assume it’s because the code for the table renders apart from the rest of the content, hence the plugin doesn’t load.

    Any way, you think, I can use both plugins? Yes,I can go back to putting table code into the content, but would rather not. Plus I’d have to style the damn tables!

    Thanks,

    B.

  41. Hi Bob,

    I see what you mean – I’ll look at this asap and try to have a new version up in the next day or two. At first guess, I must have missed something major in the logic. I’m really sorry about that.

    I’ll also have a look at the WP-Table-Reloaded compatibility issue. I suspect that we need to change the order the plugins fire. LocalCurrency is running on the post content first (before the table is there so it can’t replace the shortcode), the WP-Table-Reloaded is adding the table.

    I’ll let you know as soon as I get something up (although you should get a notiifcation of a new version from the Plugins page in the WordPress Admin area.

    Cheers,
    Stephen

  42. Okay, a new version should be appearing in your WordPress Admin panel shortly. It fixes the first problem you identified. Thanks for finding this and apologies!

    I know how to fix the second problem, but I haven’t included it in the plugin because it may actually cause more problems than it fixes. Basically you need to go to line 41 of localcurrency.php, which is in the wp-content/plugins/localcurrency folder, and which will look like this:

    add_filter('the_content', 'localcurrency');

    Change this to:

    add_filter('the_content', 'localcurrency',11);

    This will mean that LocalCurrency will fire after WP-Table Reloaded so it can actually work. Note however that next time you update LocalCurrency, this change will be lost and will need to be added again. Also note that this may mean that the currency selection box will drop down below other things which add items the bottom of the post (such as the sharing plugin you are using).

    Finally, for that post in particular, it still won’t work, because it checks for the <!–LCSTART–> tag and it won’t find it, even after that change. However, if you add the following somewhere in the post itself, it should be able to trick it into working:

    <div style="display:none"><!--LCSTART--><!--LCEND--></div>

    If you have any trouble with doing this, let me know and I’ll see if I can help further,

    Cheers,
    Stephen

  43. Bob

    Much appreciate the fast response. Upgraded and see fix for missing figures. Great.

    I’ll be trying the other change today.

    I had a thought that rather than use the hidden text trick, a Custom Field could be used, like EnableLC = Yes to kick it off somehow.

    Just an idea.

  44. Bob

    OK, good news and bad news.

    Bad news first — Second step didn’t work. Got the plugin to fire and the selector menu does appear at the bottom of the page. But the figures do not convert either onLoad on if the currency selection box is changed.

    Good News? — Making the change you suggested didn’t break any pages. Menu loads where it always did, before the share plugin.

  45. Barry

    Just to second Rick’s request from May 2008 for a per-post currency setting.

    I travel quite a bit, so it’d be nice if it could handle my mentioning the local price of a beer in Singapore in one post, along with the price of a beer in Sydney in another post, and a beer in Seville in another…

    If you’re not interested in implementing this, I may take a look at the code and see if I can add this myself if you don’t mind?

  46. Hi Bob,

    I’ve made the changes but can’t update until tonight (about 10 hours away). Changes include:

    If there’s custom field called force_lc with a value of 1, then the supporting code will be added even if there is no ‘shortcode’ on the page.

    There is a new option on the setting page called Plugin Firing Priorty, that allow you to manipulate the order it manipulates the post content (as per other comment). Default is 10.

    If you upgrade the plugin manually, you will need to activate and deactivate the plugin. If you do it via the WordPress automatic updater, then it does this for you.

  47. Hi Bob,

    As per previous comment, there is new setting to control the priorty. Once your on the new version called Plugin Firing Priorty. Try setting this to 200 after you’ve upgraded and see if that helps.

  48. Hi Barry,

    it’s open source so you’re welcome to change if you like. That said, I think I’ll probably add this. The question is, do you really want it on a per post basis, or on a per currency instance (which is what Rick suggested)?

  49. Barry

    Er, per-instance basis is what I think I meant, as per Ricky’s example.

    Assuming the Yahoo! API allows multiple calls, we could even have several currencies per article.

    ie.

    In Thailand, a 32Gb iPhone 4 costs ฿<!-- LCSTART CURR=THB-->26,000<!-- LCEND-->, whereas in the UK, it costs £<!-- LCSTART CURR=GBP-->599<!-- LCEND--> compared to $<!-- LCSTART CURR=USD-->299<!-- LCEND--> in the USA.

    What do you think?

  50. Yep that’s what I’m thinking. Although to be honest, I’ll probably do it through a proper WordPress shortcode:

    [localcurrency curr=THB]26000[/localcurrency]

    or even:

    [localcurrency curr=THB value=26000]

    as this will be easier to code. When I came up with the <!–LCSTART–> syntax, the proper WordPress shortcodes didn’t exist!

    Don’t worry though, I’ll leave support for that syntax in, as that’s what existing blogs will have.

    I’ll probably do this within a couple of weeks (I’ve got something else on this week).

  51. Bob

    Hey Stephen, I haven’t seen the update push through.

  52. Bob

    Never mind! Soon as I wrote that, the page showed “update available.”

    Let you know how it goes tomorrow.

  53. Bob

    Screw tomorrow……

    Wanna see some Currency Love? Check out the table at the bottom of the page.

    http://divinginstructortraining.com/internships/padi-instructor-complete/

    NOW, I do realize I’ve asked an awful lot of you and I told my partners I need to thank you with some cash for that. But I do have two more smaller questions, requests.

    Neither are urgent.

    1) Can I have a way to trim off the decimal places or round to the nearest whole unit?

    2) I think the answer to this is no, as it comes from Yahoo!, but can the formatting of the currency figure be improved? Specifically, COMMAS to designate thousands ($1,000) and, second, a space between the current figure (GBP, THB, etc. and the number? Seeing THB4500000 is pretty hard on the eyes!

    I’m willing to put up with #2 if I have to have the conversion. But it’d be nice.

    A W E S O M E. Thanks so much.

  54. Hi Bob,

    Glad that’s worked.

    I think there will be a way to round the figure to the nearest whole unit. I’ll have to look into number 2 though. I’ll see what I can come up with over the next week or so.

  55. Bob

    Hey Stephen,

    Any progress on chopping off the decimals (or rounding) and fixing (if possible) the display to add spaces and commas?

  56. Maria

    Hello, Stephen!

    I’ve seen this plugin in action and I think it’s awsome!
    But I have a problem: I’m currently working on my website locally (I mean it’s not hosted anywhere), and the tags don’t work. Why is this happening and will they work once I upload the website to a server?

    Also, I would really like it if I could get this to convert the currencies in the shopping cart, too (I’m using the eShop plugin). Is it possible? Am I supposed to add the tags in the .php file responsible for the shopping cart?

    Thanks in advance and I hope you will be able to help me with some answers soon.

  57. Bob

    Hi Stephen,

    Never got a reply to my earlier comment, so I’m guessing you’re quite busy. Ran into something I’m hoping you can remedy.

    You recall your fix for the problem of loading LocalCurrency through another plugin and the need to change a setting to have it fire last. Has worked great.

    HOWEVER, I just put another WP-TableReloaded table containing LocalCurrency shortcodes in a WIDDGET on my sidebar. It’s on the same page where LocalCurrency is already – successfully — being used in a WP-TableReloaded plugin table. However, in the widget, on the sidebar, LocalCurrency won’t work.

    Basically, in one table at the bottom of the page loaded by plugin, LC works. In a second table, loaded in by the same plugin, inside a sidebar widget, it doesn’t work.

    Any idea why? I’m thinking the shortcode doesn’t work in a widget. I used a text widget and put just the LC shortcodes and a figure in it (no plugin) and the page that rendered showed the shortcodes.

    Perhaps I don’t need a fix from you, just a different plugin to enable shortcodes in widgets or sidebar?

    Any help would be appreciated.

  58. Salim Baduku

    ok really excellent plugin…

    But i was working on a real estate website and was wondering how do I include into the PHP template…

    All my prices are dynamically called – So i need your plugin to do its magic via the parsing of the PHP page. I tried wrapping this in PHP tahs templates , but nothing seems to work…

    Can you help please…

  59. I am typically to running a blog and i actually appreciate your content. The article has really peaks my interest. I’m going to bookmark your site and hold checking for new information.

  60. Toshirou Hagiwara

    Hello, Stephen.

    I would like to use your program in custom fields like this,

    http://usedcar.macvox.jp/2011/02/skyline/

    but I don’t know how to do.I tried to put “force_lc” with a value of 1 but it didn’t work as I expected. It would be nice if you could give a good advice for me.

    Best regards

  61. Hi Toshirou,

    I’ll have a look at this in the next few days… It’s been a while I looked at that plugin and I’m not sure whether it can do it or what would be involved in it.

    For all those other who have left requests, I’ll try to get to yours as well.

  62. Toshirou Hagiwara

    Hi, Stephen.

    Thank you for replying and I apologize for my late responding.
    I thought if I put “force_lc” code in custom field as 1, currency selector will shows up like using “**”.
    my ideal is the price in custom field could be changed with using currency selector in this page next to “本体価格(税込)”.

    http://usedcar.macvox.jp/2011/02/step-wagen/

  63. Pingback: LocalCurrency Review – Best Wordpress Plugins

  64. Fantastic plugin!

    I think this is the only one I can find where it allows the price to be converted on the spot beside another currency, without the need for the reader to do his own math via a plugin.

    It would be nice if there was an option to lock the converted currency option though. Say, the website’s focus is Australian content, so the admin can lock converted currency to AU$ only.

    ^^

    Thanks though

  65. Dude, in your plugin instructions, you forgot to add the ‘!’ in the code.

    So it was listed as instead of

    Was wondering why it refused to work

  66. hjWX4d83Yb9pV96x28drT

    When I hit ‘Publish’ or ‘Update’ then the following code is converted from:

    $10

    to
    $10

    WordPress are adding space between ‘>’ and the ‘-‘ characthers.
    This seems to be the rason it’s not working

  67. hjWX4d83Yb9pV96x28drT

    When I hit ‘Publish’ or ‘Update’ then the following code is converted from:

    $10

    to
    $10

    WordPress are adding space between ‘<’ and the ‘-’ characthers.
    This seems to be the rason it’s not working

  68. blurb

    1st of all, thanks for such useful plugin. need some help on:

    styling, when converted the value shows up as:
    MYRRM100
    i would like to have:
    MYR RM 100

    putting price in PHP. as mentioned earlier, I also have price stored in DB, and retrieved with php.

    when looking on page it shows
    USD55
    , but in source code:
    “USD55 ”
    but it is not picked up by plugin.

    any guidelines? ideas, tips?

  69. blurb

    sorry, the symbols get filtered out. in the source code it shows full syntax.

  70. blurb

    ook.. if someone looks for this:
    MYRRM100
    i would like to have:
    MYR RM 100
    can be changed in localcurrency.js just add spaces in the list of currencies. not the best way, but.. hey it works.

    aso.. any chance to elaborate how styling works… as my currency dropdown gets torn apart from the number… any chance to shove it into DIV

  71. blurb

    just check if you are editing in “Visual” or “HTML” view.
    should be done in HTML.

  72. Lucy

    This looks great, and just what I need… the only problem is that our prices aren’t written within a blog page, but are dynamically loaded via PHP in an echo statement.

    Is there a way of using your LC tags within a PHP statement? I think this may be the same question that Salim Badaku asked above.

  73. Hi Stephen

    Thank you for a brilliant plugin. I really would like to use it but it’s not working for me, I hope you can help.

    I am based in the UK and have installed LocalCurrency Converter on my site. I asked a friend in the US to check to see if the prices on the Tuition page of my site are in US dollars. Although we played around with it for quite awhile (with the currency symbol, without the currency symbol etc), whenever she checked, it was always in British pounds. Effectively, it doesn’t convert.

    Do you have a suggestion why this might be.

    Your plugin is perfect for my site and I would dearly love to get it working.

    Kind regards
    Oretta

  74. Stephen — thanks for the great plugin! I have a question: I’m using the plugin on a site where I’m making heavy use of custom fields. Specifically, I have a custom field “price” where I store the price of some farm equipment. The trouble is, the plugin doesn’t seem to recognize currency data outside the main post. Is there any way I could tweak the code to include the content of custom fields as well?

  75. Jeremy

    Hello Stephen,

    I have recently started using your plugin and I have to say I’m very impressed with its features. Great work!

    Did you end up resolving the “NaN” error occurring in one of the previous comments? I am having the same issue with all currencies except USD. I have tried different numbers, different firing property from numbers 0-200, and using a combination of the different settings. When using the debug mode I get the following two messages (this is using the number 3598):

    Value 0 : 3598
    Converted 0 : NaN

    I am using a quite clean wordpress install with only a few extra plugins. Usually I simply create a new page, type the number, highlight it and click on the “LocalCurrency” insert tags button.

    Any solutions as to how to solve this?

  76. Hi Jeremy

    Well done on getting the plugin to work. I’ve installed it but it’s not working and it doesn’t seem as though Stephen is supporting it anymore.

    Would you mind explaining to me exactly what you did. Maybe if I follow your path I might get lucky.

    I very much look forward to your reply,
    Kind regards
    Oretta

  77. Jeremy

    Hi Oretta,

    It isn’t working properly for me either which is why I posted here. I simply installed it through the WordPress plugins dialogue in the Dashboard, and then set the settings by clicking the settings link in the plugins page. Usually I simply create a new page, type the number, highlight it and click on the “LocalCurrency” insert tags button. But only the USD currency is working.

    It’s looking like this plugin has gone obsolete since there isn’t any support here on the website anymore plus it clearly states at the top that it is only compatible with a very dated WordPress version. But see how you go.

    Kind regards
    Jeremy

  78. Thanks Jeremy.

    I think I will try and find an alternative.

    Kind regards
    Oretta

  79. Hi All,

    Sorry I haven’t been able to support this (and answer emails if you sent me one).

    At the moment I am flat out with my full time job and haven’t had time to support my free plugins. I’m hoping this will change soon – but then I’ve been hoping this for a while.

    Jeremy – it’s been a long time since the NaN last reared it’s head (4 years ago!) and I can’t remember how that ended up. I will try to look at it soon for you.

  80. Jeremy

    H Stephen,

    Haha, yeah it has been a long time. I understand if you are busy. I am just quite surprised that WordPress has no other implementation of this sort of feature. At the moment I am considering using a currency drop down from one of the ecommerce plugins, but I haven’t found one yet that has such a widget which is easy to integrate. If you do find the time please keep us in the loop.

    Thank you Stephen.

    Jeremy

  81. Pingback: WorldCurrency plugin for Wordpress | Development | How to cook the webCome ti cucino il web

  82. kim

    Hi,

    Is this plug in available to add into HTML somehow on an online shop such as Bigcartel or Shopify?

    If not, any suggestions? I have added a currency converter but would like something better.

    Kindest regards,

    Kim.

  83. kim

    Hi,

    Have you built this already for use outside of WordPress yet…I cant find anything on your site.

    Thanks,

    Kim.

  84. rom

    Hello Stephen,

    i just add your smart plugin LocalCurrency, but i got this damn Nan error.

    The debug mode says me
    Value 0 : (the number i used in my blog, aka 20000)
    Converted 0 : NaN

    Thanks for your support 🙂

  85. JC

    Some of the same errors, currently looking into it and will post if I find a fix. Pretty determined to find one as this plugin worked for me before and it’s very handy.

  86. Brooke

    Hi there, this plugin looks ideal for what I need – it’s functions seem to be exactly what my client is after for their international fees page. However, it doesn’t seem to work.

    I understand the developer is busy, but I wonder if anyone can help. I’ve set it up and installed it correctly, but when I go to view the results in the frontend of my WP site, it renders as:

    $10

    Instead of showing the currency options.

    Using the most recent version of WP.

  87. Hi Brooke,

    Can you please provide me a link to your site so I can have a look and see what’s happening? It’s working for me on WordPress 3.4.1 which is the latest version. Which version of WordPress are you using?

    There are a couple of possible reasons that would prevent this from working:

    1. A conflict with another plugin. It may be possible that another plugin is filtering the post content before (or after) Local Currency. Are you running any other plugins that change the post content?

    2. A conflict with some other JavaScript that’s running on your site. If you give me a link to have a look at your site, I might be able to work out if this is the problem.

    If you give me some further info, I’ll look into this.

  88. Brooke

    Wow, thanks for your reply! Sorry I did not double-check my post after I sent it, it renders as (without spaces) as can be seen where I tried testing this plugin’s shortcode near the top of this page on the site I’m putting together here:

    Fees page

    Yes, I did put the code into the HTML editor. Yes, I have tried disabling all the other plugins I’m using with no change. I’m using 3.4.1, same version as you. 🙂

    I’m not too clued up on javascript unfortunately, so any help you can give would be greatly appreciated.

  89. Hi Brooke,

    When I look at the source of that page, it actually has:

    <--LCSTART-->$10<--LCEND-->
    (that’s not showing, the < is actually & l t ; and the > is actually & g t 😉
    It should have:

    <--LCSTART-->$10<--LCEND-->
    (but without the spaces, I’m not sure why they are appearing!)

    Even though they look the same, they are actually different and the plugin will only work with the second syntax. I’ll look at making it more robust in future versions, but for now, could you please try editing the post / page in the HTML Editor and actually typeing in the < and the >?

    Let me know if it still doesn’t work.

    Cheers,
    Stephen

  90. Brooke

    Thanks for that Stephen, I have tried typing the code in by hand but it still doesn’t appear to be working.

  91. Hi Brooke,

    Okay – I’ll have to think about what to try next. It’s working for me, but I’ll try to break it! The problem isn’t happening at the JavaScript level, it’s happening at the WordPress level before the page is created. Anyway, I’ll look into it (although I’m at work now so it will probably be tonight before I can even start looking at it).

  92. Hi Brooke,

    I’m so embarrased, but I think it’s because of a simple typo on my behalf in the article above! I say to use this:

    <--LCSTART-->$10<--LCEND-->

    when in fact it should be this (note the 2 extra exclamation marks):

    <!--LCSTART-->$10<!--LCEND-->

    I’ve fixed this up now in the article above. Thanks for helping me find this. Let me know if it still doesn’t work for you.

    Cheers,
    Stephen

  93. hi,

    we moved to a new hosting and now the LocalCurrency is not working on the website 🙁
    it shows the correct HTML coding for printing the foreign currencies, but it just not prints anything

    above is mentioned that maybe the server/wp is not allowing the connection to Yahoo.
    how can we check this?

    i turned on/off several (new) plugins and know for sure that is not causing it, as it does not change anything

    as an example you can see this page
    http://diving-instructor-training.com/internships/padi-instructor-complete/

  94. Hi Daniel,

    I’ve had a look at your site and I can see that the Ajax request is being made from the page to your server to get the rate from Yahoo, but that 500 Internal Server Error is returned. So something is definitely going wrong at the server level.

    If you go to the Settings -> LocalCurrency page, you’ll find that there is a Debug option. Could you please turn this on and Save, then load the PADI page again. It should popup a handful of messages. If you could email me what they say, that might help me look into it.

    Note, once you have the numbers you should turn the Debug setting off, as you don’t want the popups to get in the way of real visitors.

    Cheers,
    Stephen

  95. AWESOME This is the most amazing app I have come across for Word Press. If you have any prices on your website you should add this Plugin to it.

    Thanks this is inspirational work.

  96. Hi Stephen,

    This has been an answer to our prayers as people were asking what their currency price would be in relation to our UK prices. Installed and all works a treat apart from it doesn’t appear to recognise the decimal point so £2.99 is read as £299. Quite a difference in price 😉 Is there a work around please or does this plugin only recognise whole numbers?

    Cheers!

  97. Hi John,

    Sorry about the delay in responding – I’ve verified this is a problem (and a huge one!) and I’ll try to fix it up ASAP.

    Cheers,
    Stephen

  98. Hi all. Version 2.4 has been uploaded to WordPress.org and fixes the decimal place bug.

  99. I managed to retrieve the 2.1 version and all works again, so ignore my last post =)

  100. Hi Tony,

    Glad you’ve got 2.1 and it’s working for you (though I can’t see it on your site). I haven’t had any problems with 2.5, but I’d like to learn more about what went wrong, if you could describe it.

    Thanks,
    Stephen

  101. Asia

    Great plugin. I’m having a small problem. I can’t get the converted amount to show up inside parentheses. What I’m seeing is something like this:

    The price of a dozen ears of corn yesterday at the market was just £2 USD$3.65.

    It should display like this:

    The price of a dozen ears of corn yesterday at the market was just £2 (USD$3.65).

    But it isn’t.

    Also as a side note, USD$3.65 is incorrect. It should be either US $3.65 or USD3.65. To have both the D and $ is redundant, since the D and $ are both short versions of the word “Dollar” (D being part of the Acronym and $ being a symbolic representation). Would there be any easy way for me to modify the plugin code to remove the D? I’d also like to do the same for other currencies, so EUR€1.70 becomes €1.70 and AUD$3.00 becomes A$3.00 (which is the way it’s written in Australia when clarity is desired to differentiate it from other currencies that use the $ symbol – see here: http://en.wikipedia.org/wiki/Australian_dollar)

    Thanks!

    Similar

  102. Hello I have this plugin installed on one test page, using

    £40
    plugin is active and set but
    it shows as £40 but the “show currencies” box does not display, wp ver 3,8..

    any idea what I have done wrong

  103. When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I
    get several emails with the same comment. Is there any way you can remove
    people from that service? Appreciate it!

  104. diallo

    Hello,
    very nice plugin! working great but the conversion is not very accurate. I tried converting the same
    Amount on both (website and yahoo finance) and the results are a little different. Any explanation? Thanks

  105. amit

    Why this plugin is not working with page-template ?
    Please could you tell me how this will work ?

  106. amit

    Hi, i posted the below comment regarding the plugin on 24th July 2014 but it is still unanswered from your side, Could you plz acknowledge this and update me.
    Its a bit of urgent for me.

    Why this plugin is not working with page-template ?
    Please could you tell me how this will work ?

  107. Joe Salmon

    Hi Stephen,

    Just want to report a small bug. For the conversion to Chilean Pesos the official abbreviation is CLP. In the flie: localcurrency-activate.php, line 411 you have it listed as CLF. I think this error is also in the database someplace (maybe, “get_country_code” ?). Anyway, the result is that it returns a NaN error (CLFNaN)
    for IP addresses located in Chile. It appears the fix might just by a single letter replacement, but I don’t know where to look in the DB. Thanks, Joe

  108. I tested on one site version 2.6 . I am not seeing the bottom of the post option for currency INR etc.. I am using wordpress 4.0. any modification needed ??

  109. regarding plugin local currency—— I find now it is popping out conversion rate —– ok.
    Probably ,it is not getting rate . Is that a cron job to be set ?? or yahoo is not free service ??

  110. Hi, I installed the plugin but unfortunately it didn’t work.

  111. Libor Vojtek

    There is no more SKK for a few years now. 😉
    Maybe you should check other countries at EU.

  112. Hi developing a new site and in the Q&A http://naankuse.com.gridhosted.co.uk/questions/how-much-does-it-cost-to-volunteer/ I am using Formidable to create a calculated [input].

    Whilst I can get the tags [input] to wrap the calculated input field (which there are six … only one shows when the rules allow) your javascript is not appearing just the comment tags. I assume this is due to the javascript which is displaying the value once calculated and your code doesn’t see a value / or even trigger? Messed with plugin firing priority to no affect.

    Any ideas?
    Thanks
    Ian

  113. DebF

    Hi Stephen,

    Conversions from IDR (Indonesian Rupiah) to USD, EUR, CAD, AUD and others are not correct.

    For example this USD price displayed is wrong:

    Price: from IDR 7890000 (USD$789.00) per person.

    Correct (from Yahoo Finance) is :

    Price: from IDR 7893566 (USD$583.95) per person.

    I’m sure this is due to the rate returned from Yahoo for 1 IDR = .0001 USD , .0001 EUR .0001 AUD, .0001 CAD or….

    The plugin won’t return correct values for base currencies with lots of zeros!

    Any chance for this to be corrected?

    Otherwise it’s a great, and VERY useful plugin. I can imagine you couldn’t support and make a little income off it. I’ve had plenty of clients who would use it.

    Thanks,
    DebF

  114. DebF

    Correction to 7 Aug 2015 post:

    For example this USD price displayed is wrong:

    Price: from IDR 7890000 (USD$789.00) per person.

    Correct (from Yahoo Finance) is :

    Price: from IDR 7890000 (USD$583.95) per person.

  115. Stephen Cronin

    Hi DebF,

    Sorry for taking so long to notice this! I’ll try to look into this over the next day or two.

    Cheers,
    Stephen

  116. Stephen Cronin

    Hi again DebF,

    Just a quick note to say that I’ve replicated this and it is indeed because Yahoo is returning 0.0001 as the exchange rate. I’ll have to see whether I can get a more explicit rate from somewhere else, as there’s not much I can do with what they are returning… 🙁

    Cheers,
    Stephen

  117. hi
    before getting to much into the code …. can i use this plugin with woocommerce ?
    I know others – but this will do 🙂
    regards
    Tine

  118. Hi Tine,

    No sorry, at the moment it doesn’t integrate with WooCommerce, but there a number of plugins out that there that do. Best of luck!

    Cheers,
    Stephen

  119. I see you don’t monetize your website, don’t waste your traffic, you
    can earn additional bucks every month because you’ve got high quality
    content. If you want to know how to make extra money, search for:
    Boorfe’s tips best adsense alternative

Comments are closed.