Download the PHP package umpirsky/locurro without Composer
On this page you can find all versions of the php package umpirsky/locurro. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package locurro
symfony upgrade fixer • twig gettext extractor • wisdom • centipede • permissions handler • extraload • gravatar • locurro • country list • transliterator
Locurro
:euro: Local currency converter.
Use Case
Imagine you have an online store, and you are selling products in many different countries. Some of your buyers might live in country that uses currency other then one you use in your store. It would be cool to give them estimation of product costs in their domestic currency.
Here is one example of showing approximate price under the brackets:
And it automatically detects users default currency based on their IP address for example.
Pretty cool, huh? :smile:
Basic Usage
Convert based on currency
Full example in examples/currency.php.
Convert based on locale
Full example in examples/locale.php.
Convert based on country
Full example in examples/country.php.
Convert based on IP address
Full example in examples/ip.php.
Advanced Usage
Chaining providers
Locurro uses Swap library for exchange rates.
There are multiple exchange rate providers supported:
- European Central Bank Supports only EUR as base currency.
- Google Finance Supports multiple currencies as base and quote currencies.
- Open Exchange Rates Supports only USD as base currency for the free version and multiple ones for the enterprise version.
- Xignite
You must have access to the
XigniteGlobalCurrencies
API. Supports multiple currencies as base and quote currencies. - Yahoo Finance Supports multiple currencies as base and quote currencies.
- WebserviceX Supports multiple currencies as base and quote currencies.
- National Bank of Romania Supports only RON as base currency.
Array
Retrieves rates from a PHP array.
You can chain them, see example in examples/ip-chained.php.
Caching
You can cache exchange rates using Doctrine cache or Illuminate cache.
Example is available in examples/ip-cached.php.
Twig integration
There is a Twig extension provded in the source code.
All versions of locurro with dependencies
mathiasverraes/money Version ^1.2
willdurand/geocoder Version ^3.0
geoip2/geoip2 Version ^2.3
florianv/swap Version ^2.2
zf1/zend-locale Version ^1.12
zf1/zend-currency Version ^1.12