PHPackages                             ournameismud/currency-layer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ournameismud/currency-layer

ActiveCraft-plugin

ournameismud/currency-layer
===========================

API integration with https://currencylayer.com/

1.0.5.5(5y ago)38422[2 issues](https://github.com/ournameismud/currency-layer/issues)MITPHPCI failing

Since Sep 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/ournameismud/currency-layer)[ Packagist](https://packagist.org/packages/ournameismud/currency-layer)[ RSS](/packages/ournameismud-currency-layer/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

Currency Layer plugin for Craft CMS 3.x
=======================================

[](#currency-layer-plugin-for-craft-cms-3x)

API integration with

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require ournameismud/currency-layer

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

Currency Layer Overview
-----------------------

[](#currency-layer-overview)

This is a plugin layer for the [Currency Layer API](https://currencylayer.com/) that lets you store and retrieve currency values locally. If you use this in conjunction with Craft Commerce it will populate the conversion rate values for corresponding Payment Currencies.

Configuring Currency Layer
--------------------------

[](#configuring-currency-layer)

To use this plugin you will require an API key from Currency Layer. A basic account is free but rate-limited to [250 Requests/mo](https://currencylayer.com/product).

Options available in the plugin can be saved in `Plugin > Settings` or via [a config file](https://docs.craftcms.com/v3/extend/plugin-settings.html#overriding-setting-values).

The plugin settings available are:

- *apiKey* the Currency Layer API key
- *primaryCurrency* the primary currency you want to use as the base for conversions
- *apiCache* whether to cache the response (recommended)
- *cacheDuration* how long you want the cache to be stored/saved for

Using Currency Layer
--------------------

[](#using-currency-layer)

You can use Currency Layer in one of two ways. The first way is via an `action`. This is best used in conjunction with a CRON job to fetch the results periodically. The action can be triggered via a URL as follows:

`http://your.domain.com/actions/currency-layer/currency/fetch?currencies=EUR,GBP,USD` with the currencies parameter being a comma-separated list of currencies you wish to retrieve. Note that the base (free) version of Currency Layer will always default to USD as the source.

If you are using Craft Commerce this action will save the conversion rates directly into your Commerce settings. Otherwise the conversion values are available via the `craft.currencyLayer.fetch()` variable:

`craft.currencyLayer.fetch(request,type)` where `request` is required and should be an object of key:value attributes corresponding to the endpoints for the [Currency Layer API](https://currencylayer.com/documentation) you require (please note that many of the endpoints are limited to paid-for accounts). The `type` parameter corresponds to the type of query you wish to make (defaults to `live`).

For example, `{% set data = craft.currencyLayer.fetch({ currencies:'EUR,GBP,USD' }) %}` would fetch the following endpoint: `https://apilayer.net/api/live?currencies=EUR,GBP,USD&access_key=YOUR_ACCESS_KEY`. The response will be an array of values which provide multipliers based on the primary currency defined in your plugin settings. With this in mind we can build out a macro to perform some simple currency conversion, for example:

```
{%- macro convert(value = 1, currency) -%}
    {% set data = craft.currencyLayer.fetch({ currencies:'EUR,GBP,USD' }) %}
    {{- data[currency] * value -}}
{%- endmacro -%}

{% set GBP = 100 %}
{% set EUR = _self.convert(100,'EUR') %}
{% set USD = _self.convert(100,'USD') %}

    GBP{{ GBP }}
    EUR{{ EUR }}
    USD{{ USD }}

```

The plugin is designed to work closely with Craft Commerce currencies. If currencies are already defined in Craft Commerce the option to select a primary currency is restricted to those available in Craft Commerce. If a new primary currency is selected in the plugin then the primary Craft Commerce currency is updated and vice versa.

Currency Layer Roadmap
----------------------

[](#currency-layer-roadmap)

Some things to do, and ideas for potential features:

- Release it

Brought to you by [cole007](http://ournameismud.co.uk/)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity64

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~7 days

Total

9

Last Release

1982d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bfde66cda0dee63eb0f7b9d546aac9da055d22b432871e5c620c01e48a2beca2?d=identicon)[ournameismud](/maintainers/ournameismud)

---

Tags

cmsCraftcraftcmscraft-plugincurrencylayer

### Embed Badge

![Health badge](/badges/ournameismud-currency-layer/health.svg)

```
[![Health](https://phpackages.com/badges/ournameismud-currency-layer/health.svg)](https://phpackages.com/packages/ournameismud-currency-layer)
```

###  Alternatives

[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.4M46](/packages/nystudio107-craft-seomatic)[verbb/image-resizer

Resize assets when they are uploaded.

127269.1k7](/packages/verbb-image-resizer)[verbb/formie

The most user-friendly forms plugin for Craft.

101372.9k40](/packages/verbb-formie)[verbb/tablemaker

Create customizable and user-defined table fields.

40168.8k1](/packages/verbb-tablemaker)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
