"Any Currency" Magento 2 extension
A must have extension for those who accept cryptocurrency in Magento2 online shop. This allows you to install any custom currency to Magento2 so your customers will see the exact prices and place orders in preferred currency.
Magento2 "Any Currency" extension is listed on the Magento marketplace.
- No out-of-the-box ability to add Bitcoin as a currency.
- Fixed price precision - 2 decimals. Bitcoin needs at least 6 decimals, Ethereum - 4 decimals, etc.
- No embedded service to update Bitcoin exchange rate.
- Exchange rate can be updated no more than once a day.
Thus, even if you install a payment module to accept payments in Bitcoin, your customers will only see the price in Bitcoin at the time of placing order.
This extension overcomes all these limitations at once. It provides the means to install and manage any custom currency using mouse clicks.
Third party accounts
Yahoo APIs - Removed in Magento 2.3
Webservicex - Removed in Magento 2.3
Frankfurter - API key is not required. Almost all currencies (except cryptocurrency) are supported.
CoinAPI - API key is required. The service provides up to 100 requests per day on free subscription plan (approximately one request per 15 minutes). It supports over 4,000 crypto and fiat currencies. To get an API key, you must sign up for a free or paid plan here: https://www.coinapi.io/pricing. Please note that if you use multiple websites, you will need a separate API key for each domain.
- Coingate (payment processor) - Public access. API key is not required. The service provides both cryptocurrencies and fiat currencies.
- CoinPayments (payment processor) - Free account is required to get public and private keys to access API. The service provides the rates of almost all existing cryptocurrencies and all major fiat currencies.
- Bitpay (payment provider) - Public access. API key is not required. The service provides the rates of the most popular cryptocurrencies and major fiat currencies
The module will replace the currencies offered by Magento with your own currencies. The currencies can be managed the same way as usually.
All the enabled currencies will be imported once the module is installed and enabled. New currencies can be added and managed via Magento backend interface.
Any standard or non-standard currency can be installed instantly.
Price precision is assigned to each installed currency. Price precision may vary from 0 to 8. So, the display currency will use its own price precision.
- It is possible to create up to three currency rates import schedules and assign any schedule to each currency individually. For example, it is quite sufficient to import the rates of Euro or UK Pounds once a day. As for cryptocurrency the rates must be imported as often as possible. So the merchant can create two independant schedules.
The time interval of currency rates import can be configured starting from once per minute. Minute-wice rates import scheduling is extremally useful for the stores with cryptocurrency.
- Each currency can be assigned its own rates import service. So, you can continue to synchronize the rates of Euro or Pounds via Currency Converter API, while Bitcoin and Ethereum will get the rates from Coinpayments.
A merchant can showcase the supported currency list on frontend including currency specs and description.
- Currency Rates setup page was re-designed so that any number of currencies can be displayed in multiple rows. Number of currencies per row can be set in Configuration menu.
The module was tested with the following Magento versions: 2.1.x, 2.2.x, 2.3.x
- Unpack the package ZIP file on your local computer
- Using FTP/SFTP/SSH client upload the unpacked extension to Magento root directory. Make sure you use “Merge” mode when uploading data to your server, so that the uploaded directories will not replace the content of the existing ones. Almost all FTP clients use Merge mode by default.
- Connect your Magento root directory with SSH. Make sure you act as file owner.
- Run the following commands one by one:
$ php bin/magento setup:upgrade
$ php bin/magento setup:di:compile
$ php bin/magento setup:static-content:deploy
In case you are not quite sure how to manage this or you have complicated configuration you can order professional installation service
Once the modules are installed all the existing currencies will disappear from the lists of installed and allowed currencies. So, the first thing you need to do is to install the required currencies
To install and manage your currencies please proceed to Store -> Manage currencies menu.
Those currencies that were enabled will be pre-populated. You will need to add some settings to them however: select the rate import scheduler, import service, price precision and optionally - the icon (avatar)
To add new currencies click “Add new currency” button and fill in the form. The required fields are only Currency name and Code. All other fields are optional.
If you set the currency as Inactive it won’t be shown up in Magento’s lists of installed and allowed currencies. If you do not change this than the default import schedulerand default import service will be used with given currency.
Note: if you wish to deactivate the currency you will need to unselect it as well in the list of allowed currencies.
If you switch RSS on this currency will appear in your RSS channel on frontend.
Frontend section is used if you plan to display the currency list and currency info pages on frontend. You can setup meta data and URL key for currency info page.
The avatar is also used in backend currency list.
If you run multilingual site you can translate currency name and frontend info using i18n.
The module distribution contains a directory i18n with sample files for English and Russian languages. You can append your info into existing files or create similar files for desired languages
To assign Import Rate Scheduler you need to enable corresponding schedules in the section Configuration -> General -> Currency settings
When you finish the installation of currencies the currency grid will look like this:
Some parameters: Currency name, Symbol, Is active, Precision and Sort order can be edited directly in the grid.
Then you need to select the installed currencies as you do it in standard Magento installation. Please proceed to Configuration -> Advanced -> System -> Currency and select the currencies you need from the list and click Save button.:
The module creates new cron group: kozeta_currency that can be configured within the same section.
But we recommend to leave the default settings unless you have some special requirements. See more information about cron and group settings in Magento DevDocs
Seting up Allowed currencies
Now you will need to choose allowed currencies, Base Currency and Default Display Currency in Configuration menu. You will do that the same way as in standard Magento installation:
Configuration -> General -> Currency Setup
Note: If you accept cryptocurrencies in your shop you most likely will not want to use them as base due to their high volatility nowadays.
Frontend display currency settings
If you want the list of installed currencies to be displayed on frontend you can use these display options.
Currency list is displayed on a separate page. This page link can be placed on either or both Top Menu and/or Top Links menu.
Top menu title will be displayed in front of category links on Top Menu or disable if this field is not filled in.
Top links title of the currency list link will be displayed after default welcome message if you fill in this field.
Enable currency description pages - if set to Yes then description page for each currency will be enabled and shown like on the screenshot:
Currency Rate Settings
Currency Rate Settings group contains one parameter: Number of currencies per row. Its value defines the number of currencies displayed in one row in Currency Rate page. It is useful only if you have large number of allowed currencies that will not fit in single row as it happens in standard Magento configuration. E.g. if you have eight currencies you can split them into 2 rows. This will look like this:
Please note that this value can be modified in Configuration interface in Global scope only.
A currency will be shown on this page if it is set as Active and selected in the Allowed Currency List.
In order to import the rate of a given currencies please make sure that the selected service supports those currency codes.
Scheduled Import Settings - some new features were added to this settings group:
If disabled it will hide all other parameters:
Enabled Minute-wice scheduling - if enabled it will allow you to schedule the currency rate import frequency starting from once per minute. It will hide the standard Magento scheduler and show its own Schedule parameter:
This utilizes the crontab scheduling definitions to schedule the import. For more details please check this article: https://en.wikipedia.org/wiki/Cron
For example, as it is shown on the screenshot the import will run every 15 minutes.
All Scheduled Import Settings parameters now are shown in Global scope only, except for Error Email Recipient that remains in Store scope and Error Email Sender and Error Email Template remain in Website scope.
Current version: 1.0.4
- Bug fixed: incorrect currency names displayed in Allowed Currency list (backend - configuration)
- Some minor improvements and code refactoring.
- Bug fixed: some currency rate import services fail to import rates if base currency is not "USD"
- CurrencyConverterApi (version 7) now requires API key. API key added and protocol upgraded.
- Please note that this demo is being initialised at minute 0 past every 2nd hour. So, at 00:00, 02:00, 04:00, ... 22:00 whatever you changed or inserted will be reset.
- This demo installation runs in developer mode. However we suggest you clear cache each time the settings is changes in order to make sure the changes to take effect.