kerns/craft-forex

Craft 3 plugin that converts currency using API & local storage, based on @leowebguy's Currency Converter

Maintainers

Details

github.com/kerns/craft-forex

Source

Installs: 76

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 1

Type:craft-plugin

1.0.2 2020-04-07 22:43 UTC

This package is auto-updated.

Last update: 2024-04-24 17:50:06 UTC


README

Craft 3 plugin that converts currency using Rapid API + local storage. Based on Currency Converter by @leowebguy.

icon

 

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

screenshot1

 

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) }}