kerns / craft-forex
Craft 3 plugin that converts currency using API & local storage, based on @leowebguy's Currency Converter
Installs: 77
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Type:craft-plugin
Requires
- craftcms/cms: ^3.1.0
- guzzlehttp/guzzle: 6.5.2
Requires (Dev)
- overtrue/phplint: ^1.2
README
Craft 3 plugin that converts currency using Rapid API + local storage. Based on Currency Converter by @leowebguy.
Installation
Open your terminal and go to your Craft project:
cd /path/to/project
Then tell Composer to load the plugin:
composer require kerns/craft-forex
In the Control Panel, go to Settings → Plugins and click the “Install” button for Craft Forex.
Go to rapidapi.com/natkapral/api/currency-converter5 → Get your Free API Key
In the Control Panel, go to Settings → Craft Forex and save your API Key
Usage
{% set amount = craft.entries.section('my-section').one().numberfield %} {{ craft.currency.conversion('USD', 'EUR', amount) }}
Also passing number as string:
{{ craft.currency.conversion('USD', 'EUR', 23) }}