Google Currency Converter - AJAX version

This module allows you to add the Google Currency Converter in a module position.

The module makes use of the Currency Converter from Google Finance. (Scroll to the bottom right and you'll see the Currency Converter.)


Unique Features

  • Performs currency conversion by connecting in real-time at the backend to the Currency Converter from Google Finance. So you get the most up-to-date currency rate as provided by Google Finance.
  • Uses AJAX to display the result - no reloading of pages required!
  • Full CSS support! This means that you can set the font family, font size, foreground and background color of the input field, submit button, etc.
  • The module can be included in a content item! (see below for details)
  • Available for all Joomla versions: Joomla 1.0.x, native 1.5.x, 1.6.x, 1.7.x and 2.5.x!

Complete list of Currencies supported by Google

Note: If your currency is not listed below, you may want to try the Yahoo Currency Converter which provides 62 more currencies than Google. View the additional currencies provided by Yahoo.

  1. AED - United Arab Emirates Dirham (AED)
  2. ANG - Netherlands Antillean Guilder (ANG)
  3. ARS - Argentine Peso (ARS)
  4. AUD - Australian Dollar (AUD)
  5. BDT - Bangladeshi Taka (BDT)
  6. BGN - Bulgarian Lev (BGN)
  7. BHD - Bahraini Dinar (BHD)
  8. BND - Brunei Dollar (BND)
  9. BOB - Bolivian Boliviano (BOB)
  10. BRL - Brazilian Real (BRL)
  11. BWP - Botswanan Pula (BWP)
  12. CAD - Canadian Dollar (CAD)
  13. CHF - Swiss Franc (CHF)
  14. CLP - Chilean Peso (CLP)
  15. CNY - Chinese Yuan (CNY)
  16. COP - Colombian Peso (COP)
  17. CRC - Costa Rican Colon (CRC)
  18. CZK - Czech Republic Koruna (CZK)
  19. DKK - Danish Krone (DKK)
  20. DOP - Dominican Peso (DOP)
  21. DZD - Algerian Dinar (DZD)
  22. EEK - Estonian Kroon (EEK)
  23. EGP - Egyptian Pound (EGP)
  24. EUR - Euro (EUR)
  25. FJD - Fijian Dollar (FJD)
  26. GBP - British Pound Sterling (GBP)
  27. HKD - Hong Kong Dollar (HKD)
  28. HNL - Honduran Lempira (HNL)
  29. HRK - Croatian Kuna (HRK)
  30. HUF - Hungarian Forint (HUF)
  31. IDR - Indonesian Rupiah (IDR)
  32. ILS - Israeli New Sheqel (ILS)
  33. INR - Indian Rupee (INR)
  34. JMD - Jamaican Dollar (JMD)
  35. JOD - Jordanian Dinar (JOD)
  36. JPY - Japanese Yen (JPY)
  37. KES - Kenyan Shilling (KES)
  38. KRW - South Korean Won (KRW)
  39. KWD - Kuwaiti Dinar (KWD)
  40. KYD - Cayman Islands Dollar (KYD)
  41. KZT - Kazakhstani Tenge (KZT)
  42. LBP - Lebanese Pound (LBP)
  43. LKR - Sri Lankan Rupee (LKR)
  44. LTL - Lithuanian Litas (LTL)
  45. LVL - Latvian Lats (LVL)
  46. MAD - Moroccan Dirham (MAD)
  47. MDL - Moldovan Leu (MDL)
  48. MKD - Macedonian Denar (MKD)
  49. MUR - Mauritian Rupee (MUR)
  50. MVR - Maldivian Rufiyaa (MVR)
  51. MXN - Mexican Peso (MXN)
  52. MYR - Malaysian Ringgit (MYR)
  53. NAD - Namibian Dollar (NAD)
  54. NGN - Nigerian Naira (NGN)
  55. NIO - Nicaraguan Cordoba (NIO)
  56. NOK - Norwegian Krone (NOK)
  57. NPR - Nepalese Rupee (NPR)
  58. NZD - New Zealand Dollar (NZD)
  59. OMR - Omani Rial (OMR)
  60. PEN - Peruvian Nuevo Sol (PEN)
  61. PGK - Papua New Guinean Kina (PGK)
  62. PHP - Philippine Peso (PHP)
  63. PKR - Pakistani Rupee (PKR)
  64. PLN - Polish Zloty (PLN)
  65. PYG - Paraguayan Guarani (PYG)
  66. QAR - Qatari Rial (QAR)
  67. RON - Romanian Leu (RON)
  68. RSD - Serbian Dinar (RSD)
  69. RUB - Russian Ruble (RUB)
  70. SAR - Saudi Riyal (SAR)
  71. SCR - Seychellois Rupee (SCR)
  72. SEK - Swedish Krona (SEK)
  73. SGD - Singapore Dollar (SGD)
  74. SKK - Slovak Koruna (SKK)
  75. SLL - Sierra Leonean Leone (SLL)
  76. SVC - Salvadoran Colon (SVC)
  77. THB - Thai Baht (THB)
  78. TND - Tunisian Dinar (TND)
  79. TRY - Turkish Lira (TRY)
  80. TTD - Trinidad and Tobago Dollar (TTD)
  81. TWD - New Taiwan Dollar (TWD)
  82. TZS - Tanzanian Shilling (TZS)
  83. UAH - Ukrainian Hryvnia (UAH)
  84. UGX - Ugandan Shilling (UGX)
  85. USD - US Dollar (USD)
  86. UYU - Uruguayan Peso (UYU)
  87. UZS - Uzbekistan Som (UZS)
  88. VEF - Venezuelan Bolivar (VEF)
  89. VND - Vietnamese Dong (VND)
  90. XOF - CFA Franc BCEAO (XOF)
  91. YER - Yemeni Rial (YER)
  92. ZAR - South African Rand (ZAR)
  93. ZMK - Zambian Kwacha (ZMK)

Note that Google did not release any API for the Google Currency Converter (There are some APIs for Google Finance, but not for the Google Currency Converter).

Latest Version

v1.0.9 (for Joomla 1.0), v1.5.9 (for Joomla 1.5), v1.6.9 (for Joomla 1.6), v1.7.9 (for Joomla 1.7), v2.5.9 (for Joomla 2.5)
Released Apr 6, 2012

Thanks to Pongdej, the latest version can now handle the following 2 cases:

  • 25,000 will now be correctly handled as 25000
  • Any empty spaces after a number will be automatically trimmed and handled correctly

Live Demo

There are four demos available:

Prefer Yahoo Finance?

If you prefer to use the Currency Converter from Yahoo Finance as oppose to Google Finance, here it is:
Yahoo Currency Converter - AJAX version

Including this module in Content Item or Article

Since this is a standard Joomla module, you can easily include this module into a content item or article .

You can take a look at the demo here.

Tips and Techniques

Download

How to install

  1. Download and install the "Google Currency Converter" module.
  2. Make sure the module is published / enabled.
  3. Select a module position where you want to place the module.

That's it! You're now ready to use the Google Currency Converter right inside your Joomla website!

Parameters

You can set the following in the Parameters page:

  1. Use which method to retrieve data: There are now three methods to retrieve data from Google Finance.
    • The default method uses fread().
    • You can also use file_get_contents(). Note that file_get_contents() is only available in PHP5 and above.
    • Use the cURL library. For this method, you need to make sure your PHP has the cURL library installed.

    Use the default method fread() first. If it doesn't work, then try file_get_contents(), and then the cURL library.

  2. Currency From: This is the default "currency from" that will be displayed when the module is first loaded.
  3. Currency To: This is the default "currency to" that will be displayed when the module is first loaded.
  4. Label for Submit Button: Default is "Convert". You may change this to your language.
  5. Use CSS for highlight: When this is set to "No", result will be highlighted in the default yellow background. If you do not not like the default yellow background color and wish to change this to some other color, change this to "Yes". However, when you set this to "Yes", you need to define the color in the .css file of your template. Please see below for details.
  6. Layout style: There are three layout styles to choose from:
  7. Style 1 This one has the minimum width, and is ideal when you are positioning it in the left or right column.
    Goolge Currency Converter - Style 1
    Style 2 This is the same layout as used in Google Finance.
    Goolge Currency Converter - Style 2
    Style 3 This one shows everything in one line. Ideal for use in top or bottom banner-type module position, or in content item.
    Goolge Currency Converter - Style 3

Styling the Module using CSS

You can set the style of every item within the Google Currency Converter to the exact format you want through CSS. This means that you can set the font family, font size, foreground and background color of the input field, pulldown menu, submit button, etc.

For example, if you're using the default Joomla 1.5 template, define the following style in <joomla root folder>/templates/rhuk_milkyway/css/template.css. If you're using the default Joomla 1.0 template, define the following style in <joomla root folder>/templates/rhuk_solarflare_ii/css/template_css.css.

  1. Input Box
  2. div.googlecurrency input.inputbox {
    	font-family: Verdana;
    	font-size: 12pt;
    	font-style: italic;
    }
    
  3. Submit Button
  4. div.googlecurrency input.button {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  5. The options of the pulldown menu (i.e. the list of currencies)
  6. div.googlecurrency option {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  7. The selected option of the pulldown menu (i.e. the selected currency)
  8. div.googlecurrency select {
    	font-family: Verdana;
    	font-size: 10pt;
    }
    
  9. Input Label (the text "Convert" and "Into")
  10. div.googlecurrency .input_label {
    	font-family: Verdana;
    	font-size: 12pt;
    }
    
  11. The result
  12. div.googlecurrency .result {
    	font-family: Verdana;
    	font-size: 12pt;
    }
    
  13. The highlight for the result. Note: Don't forget to set the "Use CSS" to "Yes" in the Parameters page in order to change the background color of the highliglht.
  14. div.googlecurrency .highlight {
    	color: #333366;
    	background-color: #0033ff;
    }
    
  15. Use this if you wish to set the background color of the entire module block:
  16. div.googlecurrency {
    	background: #33FF66;
    }
    

Version History

  • v1.0.2 (for Joomla 1.0) and v1.5.2 (for Joomla 1.5)
    Released August 28, 2008
  • Bug Fix. When you set the default "currency from" and "currency to", in the parameters page, these options will now be correctly displayed in the frontend. Thanks to Pablo for pointing this out.

  • v1.0.4 (for Joomla 1.0) and v1.5.4 (for Joomla 1.5)
    Released May 6, 2009
  • fixed the undefined variables in mod_googlecurrencyconverter_lib.php
    Notice: Undefined index: process on line 12
    Notice: Undefined index: a on line 21
    Notice: Undefined index: process on line 22
    Notice: Undefined index: use_css on line 44

  • v1.0.5 (for Joomla 1.0) and v1.5.5 (for Joomla 1.5)
    Released May 7, 2009
  • Enable support for css styles for result.

  • v1.0.6 (for Joomla 1.0) and v1.5.6 (for Joomla 1.5)
    Released August 31, 2009
  • Added support for retrieving google currency data using file_get_contents() or fread(). So for those people with no cURL library, you can now use the module using file_get_contents() or fread().

  • v1.0.7 (for Joomla 1.0) and v1.5.7 (for Joomla 1.5)
    Released May 16, 2010
  • This is in response to the Morton's post titled "more than one google converters".

    This new version allows you to display two or more google currency converters all on the same page, each with different currency_from and currency_to.

  • v1.0.8 (for Joomla 1.0), v1.5.8 (for Joomla 1.5), v1.6.8 (for Joomla 1.6) and v1.7.8 (for Joomla 1.7)
    Released Dec 5, 2011
  • v1.0.8 (for Joomla 1.0), v1.5.8 (for Joomla 1.5), v1.6.8 (for Joomla 1.6), v1.7.8 (for Joomla 1.7), v2.5.8 (for Joomla 2.5)
    Released Jan 26, 2012
  • Native version of the Google Currency Converter for Joomla 2.5!

Comments   

+5 # jayne 2012-01-25 08:46
Hi,
I want to use this plug in within an article. Can you tell me what the code is for joomla 1.7. I can't seem to see it anywhere!! :eek:
Reply | Reply with quote | Quote
0 # kksou 2012-01-27 18:30
Hi Jayne,

Sorry for the late reply.

For joomla 1.5, 1.6, 1.7 and 2.5, the easiest way to put the Google Currency Converter into the article is as follows:

1) Install the Modules Anywhere plugin
http://extensions.joomla.org/extensions/core-enhancements/embed-a-include/6402

2) In your article, simply add the tag
{module Google Currency Converter}
and the module will appear in your article!

3) If you do not want the Google Currency Converter to appear anywhere in the module position
a) You can make sure the module position is empty (i.e. don't select any module position)
b) Or you can select Module Assignment to "No pages"

Please give it a try and let me know if it works for you.

Regards,
/kksou
Reply | Reply with quote | Quote
0 # Raakesh 2012-02-11 21:09
Hello... just a small question: How can I round up the converted results or remove the decimals in the end? The currency converter works nicely but some of my clients told me that the conversion results can be confusing, especially for someone who doesn't understand decimals at first sight. For example: Euros 130.114 can be read as 130 114 by mistake.... Thanks to reply....
Reply | Reply with quote | Quote
-2 # kksou 2012-03-01 17:45
Hi Raakesh,

Sorry for the late reply. Not sure why your comment never reach me. (The system is supposed to send an alert to me everytime there's a new comment.)

I can see your point as very valid. I've thought about this earlier too. But I have some "user interface" issue.

1) I can add a global switch in the parameter area that allows administrator to set the number of decimals. However, for some currencies, it makes sense to ignore the decimals. But for currencies like Euro or USD, I think you will need at least 2 decimals. So global switch doesn't seem to work.

2) For the same currencies, some users prefer to ignore the decimals, while others will want to have precise decimals. So how do you cater for individual preference? cookies? individual settings for each currencies?

See, it becomes so complicated that I decide to use the KISS principle. Just like my other plugin, googleMaps, I decide to keep it simple. There are many other plugins and modules in joomla.org that provide users with very complicated settings. Will just let the users have the freedom of choice to pick the other they like.

Regards,
/kksou
Reply | Reply with quote | Quote
+2 # orlandom 2012-02-29 17:01
Hi i need to more currency, how can i insert Angola - Kwanza in the currency list?
Thanks in advance for your great work!
Reply | Reply with quote | Quote
-3 # kksou 2012-03-01 17:50
Hi,

The google currency conversion is obtained from the following website:
http://www.google.com/finance/converter

As you can see, your currency is currently not provided by Google.

The Yahoo Currency Converter has a lot more currencies. But I just checked them:
http://finance.yahoo.com/currency-converter

Yahoo doesn't provide your currency too! So there's not much I can do because for both my modules, the conversion are done through Google or Yahoo.

Please keep checking with these two websites. If you see your currency appearing there, let me know and I'll add that to the module.

Regards,
/kksou
Reply | Reply with quote | Quote
-3 # Ben2323 2012-04-30 10:51
hello,
Thanks for a great extension. I was wondering twi things:

* Is it possible to make the minimum width layout even smaller, as it is bigger than the column width on my template?
* is it possible to have, instead of having "1" as the default value ("convert 1 USD into...."), another predefined value, like: "convert 85 USD into...")

Thanks a lot in advance

Ben
Reply | Reply with quote | Quote
0 # kksou 2012-05-01 19:57
Hi Ben,

For (1), please refer to the following article: Google Currency Converter - changing the width of the pulldown currency menu
http://www.kksou.com/php-gtk2/Joomla-Tips-Techniques/Google-Currency-Converter-changing-the-width-of-the-pulldown-currency-menu.php

For (2): Edit the file: mod_googlecurrencyconverter_lib.php
in the folder: /modules/mod_googlecurrencyconverter

In line 60, you will see: if ($str_a=='') $str_a = '1';

Change '1' to whatever value you desired.

Let me know if the above works, ok?

Regards,
/kksou
Reply | Reply with quote | Quote
+4 # trenkov 2012-09-18 10:56
Hi there,
Thank you for the great extention, I really like it a lot! I have a problem with the labels tough, as I use cyrillic symbols. On initial loading of the module everything is fine and the characters are displayed as they should be, but as I click the submit button and the calculation initiates, all labels become a huge mess of random symbols. I tried to convert all .php files in UTF-8 encoding but with no success. Do you have any idea why is this happening? You can try labelling for example the submit button to ??????? in order to see the result.
Thank you in advance for your answer!
Best regards,
Georgi
Reply | Reply with quote | Quote
-2 # trenkov 2012-09-18 10:59
Oops, seems that UTF-8 characters are not properly displayed here, I wanted to write a sample text in cyrillic so that it would be easier for you to diagnose the problem.
Reply | Reply with quote | Quote
+2 # lrincomes 2012-11-11 23:46
hi, nice extension, but i got a little hitch, i want to know how it works, because i have integrated the extension but its not calculating.
Reply | Reply with quote | Quote
-1 # Kev 2013-06-07 05:24
hi, I bought the option to remove the backlink, but the new installer does not work. I opened the zip file and it contains several folders, but they don't install either. Please advise!

I'm trying to install into a j2.5x site. The basic free installer works, but I would like to remove that backlink.

thanks
Reply | Reply with quote | Quote
0 # kksou 2013-06-07 07:35
Hi Kev,

Have just emailed you one more copy of the installer for the registered version.

Please give it a try one more time and let me know if it works, ok?

Regards,
/kksou
Reply | Reply with quote | Quote
-3 # Kev 2013-06-07 07:38
that's perfect thanks. Now I just need to be able to see the results ;-S

I removed the ALLOW_FURL_OPEN= OFF from my php.ini, but still don't see results
Reply | Reply with quote | Quote
+3 # kksou 2013-06-07 07:41
Hi Kev,

Thought you mentioned in your email that the free version works?

Regards,
/kksou
Reply | Reply with quote | Quote
-5 # Shimla Vision 2013-09-13 02:39
first thanks for this great module i've been using it for my sites. In 2.5 version i have noticed that it uses a lot of disk space and suddenly my disk space usage went from 50 mb to 1000 mb and this module was using 870 mb space. please can you throw some light why this is happening.....
Reply | Reply with quote | Quote
0 # kksou 2013-09-13 09:14
Hi Shimla,


People have been using this module since 2008, and you're the first one that reported such an issue.

If you look at the source code, this is really a very light module. There's nothing in the code that writes to your disk space.

May I know how do you know that it's this module using that 870 mb of disk space? What is the filename of this 50MB? And where does it write to?

Also, it seems like you have been using this module and it works fine for earlier versions. Is the 2.5 version the only one giving the problem?

Regards,
/kksou
Reply | Reply with quote | Quote

Add comment


Security code
Refresh