curreX: AJAX Based Currency Converter Widget for WordPress

A brief intro…

Past few weeks I’ve been extremely busy designing a Property Investment site for a client. The primary requirement was a custom CMS (Content Management System) – which I had to build from scratch. While it drove me over the edge at times overall it was a thoroughly curreX Screenshotenjoyable as well as an educational journey for me. Since this is a site that caters to foreign investors, one of the requirements was a Currency Conversion Calculator which could be embedded in any of the articles thus providing the visitors an opportunity to get an idea of the property prices in their native currencies, without having to leave the page. At first I sought the easy way out – i.e. I searched far & wide for a currency calculator service that’d allow me to convert between almost any of the world currencies. Unfortunately the free ones out there are really pathetic and the my client wasn’t willing to shell out any $$ for a paid service. That got me down to designing one on my own. I’ve been dabbling in AJAX for a while now and find the whole idea of RIA (Rich Internet Application) really attractive. So I decided to walk the AJAX way and came up with this cool-tool. Once done with the main project, I was so satisfied with the result that I thought it’d be a really good idea to convert it into a sidebar widget for WordPress. So here I am, with curreX – the Ajax based Currency Converter for WordPress.

Current Version

  • 0.9


  • The widget is very simple and does exactly what it’s supposed to do. It accepts a currency value (integer or decimal) and a source & destination currency and gives you the converted rate once you hit the Convert button.
  • It employs an AJAX back-end, i.e. the conversions are performed without having to refresh the whole page, making the tool really lightweight & fast. Looks cool too.
  • Performs client-side validation of the amount entered – thus cutting out chances of entering an erroneous value and crashing the calc. midway while performing a conversion.



curreX  (99.5 KiB, 6,236 downloads)


Installation couldn’t get any easier. Once downloaded, simply…

  1. Unzip the archive.
  2. Copy the extracted folder named curreX into your WordPress plug-ins folder.
  3. Activate the plug-in from the Plug-in Manager in WordPress.
  4. Visit the Sidebar Widgets page under Presentation menu to drag & drop the widget onto any sidebar you desire.

That’s it…

For those who’re using curreX with non-widget-enabled themes, you should insert the function
< ? show_currex( default_from, default_to, decimal_places, type, title ); ?>
in an appropriate place. For further details on this function & it’s parameters, refer to the FAQs section of the readme.txt bundled in the distribution.


A live demonstration of this can be found under the Coding section of my blog. Though the implementation of the demo is slightly different (it’s hard-coded into in a page), it should give you an idea on what the widget can do.

Showcase (the widget in action)

  • GoBackpacking
  • Hua-Hin Live – A customised version of the plug-in can be seen in action in the property list pages, once you’ve searched for properties

Subversion Repository

Change Log

  • Version 0.9 (2008-06-22)
    • Added Flash based Widget support. Now one has the option of choosing between the HTML/JavaScript version or the Flash version from the widget configuration panel of WordPress.
    • The structure of the show_currex() function (for non widget-enabled themes) has changed slightly too – to support embedding of the flash widget.
  • Version 0.8 (2008-06-19)
    • While releasing version 0.7 I had made some changes in the path structure (reference to any additional files that were loaded in the background) – and I messed up a bit there. As a result, the core javascript module that fetched the conversion rates and performed the calculations wasn’t loading properly.
    • Fixed some minor CSS issues. Now the look & feel of the widget can be modified in its entirety through the accompanying CSS file.
  • Version 0.7 (2008-05-16)
    • Added the functionality to display curreX in non-widget-enabled themes too (by popular demand). Till version 0.6, this plug-in could only be used in the form of a widget with widget-enabled themes.
  • Version 0.6 (2008-05-11)
    • This is a complete port to jQuery. Decided to finalise on one ajax library and jQuery emerged the winner. No more Protoculous for me.
    • Split out the styling into a separate CSS file. Anyone with even a bit of CSS knowledge, can now easily alter the looks of the widget without having to touch the core code file(s).
    • Implemented BlockUI – a jQuery plugin that blocks the widget interface while performing a currency conversion routine (ajax based).
    • Included a HELP option, that leads directly to the Chaos-Lab Forums (curreX Subforum)
  • Version 0.5 (2007-09-21)
    • Minor fix – but at the same time a major one from the perspective of functionality. The back-end URL for fetching conversion data from Yahoo! Finance had changed from to This caused the plug-in to generate a message saying “Error contacting Yahoo! Finance” and not work at all. Thanks to Lia Johnston for pointing me to the correct URL.
  • Version 0.4 (2007-03-15)
    • Fixed a minor bug that caused incorrect version reporting in WordPress plug-ins management panel.
  • Version 0.3 (2007-03-15)
    • Bundled prototype.js library along with the distribution instead of relying on a theme to have it. This way the latest version of prototype can always be bundled along with.
    • Made some minor changes in the layout for smoother functionality & improvement of looks.
    • Renamed a bunch of plug-in related variables to avoid name collision with other plug-ins.
  • Version 0.2 (2007-03-05)
    • Fine tuned the widget. Now the currency unit values are written off an array instead of the ungainly manual approach that was being used earlier on. This reduced the file-size of the main plug-in considerably despite adding new code.
    • Added the configuration section. One can now set the default currency units to be displayed when the widget loads (from & to).
    • Added a Decimal Place option, which defines the number of decimal places to show in the converted result.

Please Note

I offer support for my plug-ins via the Chaos Laboratory Support Forum only. I will NOT respond to support queries left in the comment section below and, in most cases, will also not publish them. Of course, if you’d like to say something nice or helpful, then feel free to leave a comment!

If you find this plug-in useful, please consider making a donation towards further development of this useful little utility.

Alternatively, you can help me by reviewing this post by clicking on the following link. Believe it or not, this will help us both earn some cash from PayPerPost.

A raver at heart - the only way I can aptly describe me is a bouncing ball of sheer energy. Blame it all on my air sign - but I find it extremely difficult to affix myself a certain spot (apart from when I'm sitting in with my hi-tech paraphernalia) . Traveling's foremost on my itinerary. Photography comes only second to that.. and of course there's my computer - which is the very essential elixir of life for me & deserves a special mention. My free time's spent in mastering the art of spinning Fire-Pois as well as having fun with my other trip toys. If you've no clue as to what Pois are, check out this site: The roar of blazing fire rushing past your ears gives you the most natural high ever. Apart from that Meditation helps me a lot in the course of daily life. I envision myself retiring to a li'l recluse on some secluded white-sanded island surrounded by azure waters - someday in not-too-far future.. and rave like a mad cow till my last breath... ;) On a side note, a lot of my friends have been complaining about the lack of my proper name anywhere in my profile... So here it goes - yours truly is better known as Sourjya Sankar Sen. :D Yeah, I know it's pretty long & winding & almost teeth-breaking, but my name does compliment my length and breadth quite well.

262 Responses to “curreX: AJAX Based Currency Converter Widget for WordPress

  • Simon Gheysn
    9 years ago

    its a cool feature, but it would be even more cool if you add the following:

    – select a date (using a AJAX calender)
    – get the currency info for that date:
    – open
    – close
    – high
    – low
    – allow the user to select a type of currency info that he want to use (maybe a radiobutton for each of these values) and remember this selection

    – standard fill this information with the current currency rate

    then you put your existing currency calculator

  • Simon Gheysn
    9 years ago

    oh yeah just one more thing:

    leave the convert button = its excess clickage, just update the calculated value as soon as the from or to field changes

  • Simon: Thanks a tonne for taking time out and jotting down those awesome tips. After completing the basic currency calc I was at a total loss on how to improve it further. You got me headed in the right direction again 🙂 I should be able to implement those features real soon.


  • Seppo
    9 years ago


    Looks like a great script. I couldn’t make it work though. Keep getting
    this[object error]

    Opera shows the error as this:

    name: ReferenceError
    message: Statement on line 53: Reference to undefined variable: Ajax
    Line 53 of inline#1 script in
    protoAjax = new Ajax.Request(converterURL, {method : “post”, parameters : {action : “convert”, amount : _amount, currfrom : _curr_from, currto : _curr_to}, onComplete : postConvertCurrency});
    Line 1 of script
    At unknown location
    [statement source code not available]


  • Seppo: Thank you for bringing it to my notice. There was a similar problem with Unitary – the units converter widget that operates on same principles as this widget. I managed to fix the problem for Unitary yesterday – hence fixing this one should be real easy.

    Please check this post sometime later on today for an updated release addressing the problem you’ve mentioned.

    Thanks once again 🙂

  • Seppo: I’ve fixed the problem and a new release (v0.3) of the plug-in is available for download. Simply grab the zip file from here and overwrite the old plug-in in your WordPress installation.

    That should do the trick.

    m^e 🙂

  • I’m still getting the same error. Is the updated version available from the same link above? Wordpress plugin page still shows version 0.1.

    Your help is greatly appreciated, thanks!

  • Whooops 😀 My bad. Silly mistake really…

    When I zipped the new version is got named and this is what I had uploaded to the server. I was supposed to name it so that the newer one overwrites the older version. But because of the naming mistake both the version were co-existing on the server and since the download link points to what you got as a download was the older one.. lol..

    Can you please try downloading it again. You shouldn’t face any problems anymore.


  • Seppo
    9 years ago

    Great, works fine now!

    Thanx, thanx, thanx

  • No problem at all 🙂 Am glad it worked out for you…


  • hyipcharts
    9 years ago


    I love the plug-in and it will go great on my site. However, I don’t use widgets. Can you tell me how to hard code this in my side bar?


  • I love the plugin. However, I don,t use widgets. can you tell me how to hard code this in?


  • Hi

    nice plugin work great, i like to know how i can use in non-widget theme . well my theme don’t have widget how to call in side bar . i prefer non widget theme

  • just the plugin i was looking for… just awesome.. thanks for making it available to everyone. you can see it working on my blog 🙂

  • It’s coool! Thanks!

  • Hi,

    Quick question… My theme is wordpress 2.2, but not widget enabled… yet. Can you give me the code to put the converter into the sidebar or page please.

    Thank you,


  • Hi John,
    I’m sorry to say that since I’d designed the plug-in as a widget, I didn’t include any function calls through which you can display it on a non-widget enabled sidebar. However, I can help you implement the code in your site. That shouldn’t be a problem. 🙂


  • I messed around and got something to come up, but of course it deosn’t work. I would like to set up a page on the site for a converter with USD adn Taiwan dollars the defaults.

    Here is what I have so far:

    I used this code

    I am a hacker (as in hacking code up into use able chunks without knowing what it does), not a coder so you can see where my trouble is.

  • I presume you’ve incorporated the code into a WordPress page… right? How did you go about it? Can you give me some more details on it? As in, did you create a blank page template file and inserted the code in it?

    Anyways, getting it to work shouldn’t be a problem – I’ll help you resolve this issue. Meanwhile, let us please continue this discussion at the support forum. You just need to register either at my blog or the forum.. registration occurs site-wide. I’ve created a thread for you there..


  • To fix the widget you have to change the host variable (in curreX-ajax-backend.php) to:


  • Hey Lia,
    Many many thanks to you for pointing out the correct URL. I was going crazy trying to fix this.


  • Hi This seems like a great plugin.
    I am putting as subscription wordpress site together and will use 2co as a payment system. Most of the people who will use my site will not be $ based but some will.

    What I want is to set a fee in South African rands and then next to it give the current $ amount. Or the other way around. Do you think it’s possible? Well I know it’s possible but is it something simple to do? 😉


  • Thankiossi
    It’s great

  • great plugins… thanks.

  • I have done similar tool like this using javascript only…

    computes in realtime, but I have been too busy to update the features of it. and the conversion rates aren’t updated in realtime

    see here,

  • Deepa
    8 years ago

    Is it possible to have a currency convertor version for blogger blogs..
    I would love to have one in mine …?

    Thank you

  • Sincere apologies about extremely late replies 🙂 Have more than a handful or projects and a tiny one on his way.

    Anyway, here’s to your queries:

    Johan: Yep – it’s very much possible to do so and it’s not hard at all to come up with a small block of code that’ll do what you’re seeking. If you need any assistance in putting it together, do write back.

    fedmich: Nice tool you got going there. It gave me an idea to include the ability to view comparisons in future versions of this plugin.

    Deepa: Sure it can be included into a blogger based blog – but not in it’s existing form. This one is hard-coded to work with WordPress only though the basic concept can easily be exported to blogger. I believe blogger allows for inclusion of flash / image based widgets. I’ll see if I can come up with parallel versions of this for use with other blogging engines.


  • Nice plugin! I wish I could is for non-widget enabled themes. 🙂

  • Hi there! First off… exactly what i’m looking for! Such a nice plugin… BUT…. i prefer not to use any widget themes. I’ve read a few post above here, that it is also possible to not have it working through a widget ready theme…
    Please tell me how to implement this in my sidebar 🙂


  • Phenomenal plugin! You really went in-depth here. I’ve been looking for something like this.

  • Hi,

    I posted over at your CurreX support forum as well, please forgive the duplicate effort.

    Great widget, I really would like to use it and the functionality is perfect.

    However, as I think you note in the script, it would be great to have an option to title the widget?

    As it stands, I get the white text/black background with “Currency Converter” below where, in my theme, the widget title should go. As in graphic at:

    Can you suggest how I might tweak the code?



  • Stefan
    8 years ago


    I just tried to register myself in the forum but all my attempts failed. I am not getting an email for validating my email address.

    Could you please post a manual of how to implement your great Currency Converter in a Wordpress page?



  • Hi Stefan,
    First of all sorry for the late reply 🙂 I’m using the WordPress to SMF Bridge which maps user data between these two. The version of bridge I have may have caused some conflict which in turn didn’t send out the registration email. However, if you register through WordPress here, you should be able to login into the forums as well.

    As for the installation of the code on a normal WordPress page, give me a day or two and I’ll come up with a post on that. It’s actually very easy. Till then… 🙂


  • Can you incorporate this wonderful plugin for non-widget themes in the next version?

    Something as simple as adding a line


  • Guys 😀 I give in.. i.e. I’ve received an endless number of requests for a non-widgetized version of this plug-in… so I”m going to include a separate function with which you can display this in a non-widget based theme’s sidebar. Watch out for the next release… soon 🙂


  • @ Everyone seeking to incorporate this plug-in in non-widget based themes, there’s a new version out (0.7) which lets you do just that… for further details, grab the new .zip and go through the readme.txt bundled with it.


  • Hi Above you wrote that you can help me. Thanks. That will be great. How will this work? I will enter a cost in US$ as part of the text. And next to it will be a bit of code that gives the value in South African rands. Therefore I will enter the US$ amount in the plugin code and it gives the current amount in South African rands. I will love that 😉 Thanks Johan

  • Hi,

    Thank you for a very useful widget. However, I realized that while the widget works on firefox, I get an [object error] when I use it in IE 7…and IE 6. Any ideas to work around?

  • rocketfire: I know what you’re talking about. Surprisingly, I don’t face this with curreX, but another plug-in of mine – LiveSig. Funny thing is if you try to debug the error with MS Script Editor, it points to a line in /wp-admin/js/common.js that goes like…
    jQuery(function(){jQuery('#media-buttons a').tTips();});

    It’s most likely some sort of problem with jQuery.. am trying to get to the bottom of this.

    Meanwhile, can you fill me in with further details on where you encountered this problem with curreX? It’ll be good if we can carry on this conversation at the Support Forum.


  • Unfortunately, I can’t get the 0.7 version to work on my non-widget wordpress theme.

    Whenever I insert a numeric figure (with or without decimals), the result remains as “0”. I also tried clicking on the “Convert” button, but the end result is still shown as “0”.

    What could I have done wrongly during the installation?


  • Hey Yow, I’m looking into the problem and will publish a fix ASAP 🙂 Thanks for bearing with me till then..


  • I’m having the same problems as Yow Chaun descripes!

  • Wonderful widget! Any chance I can change the result from that bold green font to black?

  • @Yow Chuan & Alexander: My apologies for not being able to reply earlier or bring out a patched release. Am on too tight schedule – but hopefully before the weekend is over I’ll be able to get to the bottom of the problem. Thanks for reporting back 🙂

    @Ian: Sure you can. Just recently I split out the styling into a separate CSS file, so as to not have the end users get into any messy code editing. In the plugin’s folder (curreX), you’ll find a file called curreX.css. Modify the styling at will….


  • Can’t get it to work in wp-2.5 pn my site at
    I can alter the default currencies and save but when it posts to the site, it reverts back to the original settings.

    Oh, one other minor thing. It does not do ANY converting, it breaks.

    Any ideas?

    Thanks, hope it works out, just what we need.

  • A few hours after install this plugin started working just perfect. Please disregard my last post, or thank you if you fixed it, or extreme thanks for such a handy tool!

    My website visitors thank you too.

    Rich Hill

  • Thank you kind sir for your reply.
    I can edit the styles fine except for the result, which appears thus in my source code:
    12.39 where those echoed HTML styles are overriding the curreX.css styles.
    Not a huge issue because the plugin works a treat but I’m curious and also a bit of a perfectionist, actually.

  • Hey there Ian 🙂
    Apologies for the late reply. I seem to have overlooked the fact that I kept certain part of the styling in the JavaScript file that updates the results field. This was necessary as I wanted to colour the error messages with red, while normal results would be returned in some other colour (choose green here to indicate – “All is fine”).

    I’ll move the styling out completely to the CSS file in the next version – but for the time-being, you can tweak around the JS file to fix your issue.

    Check in the plug-in folder for a file named curreX.pack.js. The file is compressed with JS Packer, to reduce the distribution as well as page-load time and won’t make much sense (code-wise). However, towards the bottom part of the file, there are a bunch of constants and variables delimited by pipe “|” symbols.

    You’ll notice TWO six-digit hexadecimal values there, spread quite a bit apart. They are: B91919 and 017546. If you can’t spot them visually, do a search. The first value stands for the RED colour that the result field text acquires upon facing some conversion error. Likewise, 017546 stands for the “ugly” GREEN – that you’ve come to hate 😀

    Replace these values with six-digit hexadecimal values of any other colour you like. If you want black, replace 017546 with 000000 and that should do the trick.

    If you face any difficulties do not hesitate to write back 🙂


  • I had version v0.5 installed and customized, and working. Then I upgraded to v0.7 and can’t get it to convert anymore. I was thinking about reverting back to v0.5, but I don’t have those files anymore.

    Could you take a look?

  • Josh: My apologies. While releasing version 0.7 I had made some changes in the path structure (reference to any additional files that were loaded in the background) – and I messed up a bit there. As a result, the core javascript module that fetched the conversion rates and performed the calculations wasn’t loading properly.

    No wonder I got a lot of complaints about this.

    I just released a new version (0.8) fixing this problem and this should be available from the WordPress Plug-in repository in about 15 minutes. Please update your plug-in and all should be fine..


  • Ian: You won’t have to get into any messy editing of the JS files anymore. With the new v0.8, I’ve split the styling out completely to the accompanying CSS file.

    Check for two spans – a span#result and a span#error. These two define the appearance of the converted results and the error messages.


  • hi. Thanks for plugin



  • Hmmm…still having the same problem. Not working.

  • Josh: Can you please check the curreX folder in your plugins directory and let me know if all the files are present?

    When I visit you site – the first thing that is noticeable is that the Styling in not being applied… which means that the accompanying stylesheet isn’t being loaded. I checked your page source, and accordingly tried to load the plug-in’s css file directly into my browser. That got me a 404.. so did all the other JavaScript files. This could mean that your update didn’t occur properly and / or the rest of the files required for this widget to function properly are not present.

    Please check and get back to me.


  • Alternatively.. those 404’s could be generated by WordPress – to prevent me from accessing those directories directly. Either ways, please check and let me know.


  • m^e,

    Still not working for me.

    Same problem as specified here.

  • Gees…I had “automatically” updated to the new version, but it must not have updated everything. I did a manual FTP transfer, and now it works. Who woulda thunk?

  • Josh: Thank God you got it working 😀 I was starting to loose faith in my coding skills… It can get so frustrating at times – since it always manages to work fine on my test-bed. And just when I think all’s fine with a code, a whole bunch of bug reports pour in…. 😉


  • When I try the flash version I can only see the get flash button but I have the most up to date flash. What do you think is going wrong?

  • This is a great plugin

  • Hi there, your browser sniffing script is not working – I’m on Firefox 3 / OSX and your page keeps telling me not to use IE.

    I also went to try out your currency converter (which sounds really great) on the demo page here and it throws a javascript error – not working.

  • Here is our AJAX powered currency converter for webmasters. You can easily add a currency rate calculator or exchange rate form to your website using a single line of code. Give it a try at

  • great plugin!

  • unfortunately the widget appear on my page but the converter doesn’t work:(

  • Hi there! Thank you so much for making and sharing this widget! I’m just setting up my webpage, trying to plan my trip to the US and really needed something like this. Tried to google around to find something, but of all the widgets/css codes I found this one looked great AND work accurate (not just as a static one as most of them are)! Easy to install, easy to use!

    Thank you!


  • Cannot get it working. Works perfect on localhost but when uploaded on the server, it is not working…shame, such a great plugin

  • genim
    7 years ago


    i am trying to put this plugin inside a page or post… not any sidebar or widgets… is it possible?

  • genim
    7 years ago

    another question…

    it seems that there no united kingdon (GBP).. can i add it?

    sorry for the consecutive post

  • Just wanted to say how much I love this plugin and thank you for the work you put into it. I have wp e-commerce on my site and unfortunately they clash with each other. The flash version of curreX is fine with e-commerce but I’d rather not use the flash version since I am not able to customize it as well as the html version. I’m wondering if there could be a fix for this?? Thank you so much.

  • This is really cool, and I cannot wait to try it. I will have to spread the word.

  • Tried to put it on a side widget but it just does not convert the currencies.. The button is not working. Any ideas?

  • Cristian
    7 years ago

    I installed the plugin in the sidebar of wordpress, but it did not work. I could fix it and is very simple:
    1) Change the plugin status to inactive.
    2) With a FTP client, go to “wp-content/plugins”.
    3) Rename folder “currex” to “curreX”.
    4) Change the plugin status to active.
    5) And that’s all! 🙂

  • How do I apply default amount and result without pressing the ‘convert’ button?

    Tx again for the plugin!

  • Btw, your list of currencies seems to be missing Fiji Dollars…

  • The plugin is installed and looks like its working but on clicking the ‘convert’ button nothing happens?

  • @Macca: Which version (i.e. JavaScript or Flash) are you using?

  • not working !!

    please fix it,, 🙂

  • @jens: Please provide me with the following information.

    1. What problem did you face?
    2. Which version of Wordpress are you using?


  • Thanks for the plugin, but it’s not working for me, either.

    No results in HTML version

    Table ‘./chaosxl_forum/smf_sessions’ is marked as crashed and should be repaired

    Does that help? Would you please email this if you fix it? I’m deactivating it for now. Thanks.

  • Hello,

    thanks for your great plugin, however, I have a problem.

    My blog is on WP 3.0.
    The problem is that jQuery is causing a conflict with fancybox and other plugins. I noticed that your plugin uses a pretty old jQuery library. Do you have a solution for the problem?
    A substitution of both libraries just didn’t work.

  • @pkde: Thanks for bringing it to my notice. I haven’t updated the plugins in a while and it’s high time I do so. Will try and get an update out ASAP. 🙂

  • I will be happy to add your link to my sites blog roll. Best Regards to all from Italy.

  • Great widget! Thanks for that.

  • Just curious, what wordpress theme are you using because it appearance cool?..

Trackbacks & Pings

Leave a Reply Text

Your email address will not be published. Required fields are marked *