Skip to content

leowebguy/craft-currency-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Currency Converter

Craft plugin to convert currency using API & local storage

IMPORTANT


Installation

Open your terminal and go to your Craft project:

cd /path/to/project

Then tell Composer to load the plugin:

composer require leowebguy/craft-currency-converter

In the Control Panel, go to Settings → Plugins and click the “Install” button for Currency Converter.

Go to rapidapi.com/natkapral/api/currency-converter5 → Get your Free API Key

In the Control Panel, go to Settings → Currency Converter → Paste and Save your API Key

You can also put it in your ENV file i.e. $CC_KEY and set it over here.

CC_KEY=aaa123bbb234

screenshot1

 


Usage

The plugin exposes a Currency Converter's methods:

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