Skip to content

helpfulrobot/webtorque-currency-converter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

#SilverStripe Currency Converter

Simple service for converting currencies. 0.1.* is for SilverStripe 3.0.*

Installation

Install the module into currency-converter\ folder inside the webroot.

With composer

composer require webtorque/currency-converter

Usage

To convert $9999 NZD to USD

$convertedAmount = CurrencyConverter::get_converter()->convert(9999, 'NZD', 'USD');

Exchange rates

Default implementation uses an xml feed at http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml. Other sources and be created by inheriting from CurrencyConverter and implementing the retrieveCurrencies function.

Then change the converter config option on CurrencyConverter e.g.

CurrencyConverter:
  converter: MyCurrencyConverter

Alternatively, you can pass the name of the class into get_converter e.g.

$convertedAmount = CurrencyConverter::get_converter('MyCurrencyConverter')->convert(9999, 'NZD', 'USD');

About

Currency converter for SilverStripe CMS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%