Your EE module, plugin, and extension marketplace!
This is an Expression Engine module that allows you to get live currency exchange rates.
* Current Version: 1.1 (released 21 February 2009)
* Works with ExpressionEngine 1.6 and higher.
This module provides the ability to display prices in multiple currencies using live exchange rates. The rates are taken from the European Central Bank website and are updated daily.
The Exchange Rates module can be called from within a template as well as from an add-on. Every time the module is called it checks if the currency exchange rates have been updated in the last hour. If not then it automatically updates them.
Getting the exchange rate from one currency to another:
{exp:exchange_rates:get_rate from="EUR" to="USD" decimals="5"}
The from parameter is required and represents the currency code of the currency we want to get the rate from.
The to parameter is required and represents the currency code of the currency we want to get the rate to.
The decimals parameter is optional and if included defines how many decimal places the result will have.
Converting a specified amount from one currency to another:
{exp:exchange_rates:convert amount="100" from="USD" to="JPY" decimals="2"}
The amount parameter is required and represents the amount that we want to convert. The amount value can be a field value within a weblog entries tag.
The from parameter is required and represents the currency code of the currency we want to convert from.
The to parameter is required and represents the currency code of the currency we want to convert to.
The decimals parameter is optional and if included defines how many decimal places the result will have.
The module can be called from within an add-on as follows:
// create exchange rate object
if (!class_exists('Exchange_rates'))
{
require '/home/mypath/public_html/system/modules/exchange_rates/mod.exchange_rates.php';
}
$ER = new Exchange_rates();
$USD_to_EUR_rate = $ER->get_rate('USD', 'EUR');
Download and unzip exchange_rates.zip, then follow the steps below: