Skip to content
15+ installs
currency_exchange
Prices and currency e5octcmb v1.0.0

E5 OC TCMB Exchange Rates

Updates your OpenCart 2, 3 or 4 store’s exchange rates from the daily TCMB bulletin.

OpenCart 2 and older OpenCart 3 versions fetched exchange rates from Yahoo Finance. That service is gone, so the refresh button on the Currencies screen no longer updates anything. Newer OpenCart 3 and 4 versions ship only with foreign sources such as the European Central Bank. E5 OC TCMB Exchange Rates connects the currency refresh to the daily exchange rate bulletin of the Central Bank of the Republic of Turkey. Every currency in your store is updated when TCMB publishes it. Currencies missing from the bulletin keep their value and are listed on screen. Depending on your version it installs as an OCMOD or as a currency engine extension, and never edits core files by hand.

How it works

One-click refresh

Press the refresh button under System → Localisation → Currencies. The extension downloads the TCMB bulletin, writes the value of every currency except your default one and clears OpenCart’s currency cache. Store prices show the new rates right away. On OpenCart 3.0.4 and later and on OpenCart 4 you first select this extension as the currency rate engine in the store settings.

Automatic updates

OpenCart 4 runs its own currency cron job every day; when this extension is the currency rate engine, rates are updated from TCMB every day by themselves. On OpenCart 3.0.4 and later the extension page gives you a ready cron command. With “Auto Update Currency” on, OpenCart 2 and 3 also update rates when you open the admin panel; TCMB is contacted at most once an hour.

Every bulletin currency

Not only USD, EUR and GBP: every currency in the TCMB bulletin is supported, including CHF, JPY, CNY, RUB, SAR, AZN and more. Your default currency can be any of them too; rates are cross-calculated from it.

Correct unit handling

TCMB quotes some currencies per 100 units instead of 1, such as the Japanese yen. The extension reads the unit from the bulletin and converts the rate to a single unit, so currencies like JPY are never off by a factor of 100.

Clear result message

On OpenCart 2 and on OpenCart 3 up to 3.0.3, the screen shows the bulletin date and the updated currencies after a refresh, and lists currencies TCMB does not publish separately. When the TCMB server cannot be reached or its data cannot be read, a red warning appears and no rate is changed. On OpenCart 3.0.4 and later and on OpenCart 4, the result of the last update is shown on the extension’s own page.

Turkish and English

When your admin panel is in Turkish, every message from the extension is in Turkish. In any other admin language the messages are in English. No separate language pack is needed.

A package for your version

The OpenCart 2 package is an OCMOD with a single install.xml; it copies no files, so OpenCart 2 does not need FTP settings. The OpenCart 3 package works on every 3.0 version: as an OCMOD up to 3.0.3, and as a currency engine under Extensions → Currency from 3.0.4 on. The OpenCart 4 package is a currency engine extension. All of them are uploaded in the Extension Installer.

Highlights

  • check_circle Rates come from the daily TCMB bulletin
  • check_circle Separate packages for OpenCart 2.x, 3.x and 4.x, including the latest 3.0.5.1 and 4.1.0.4
  • check_circle Every currency TCMB publishes is supported
  • check_circle Your default currency can be TRY, USD, EUR or any currency in the bulletin
  • check_circle No rate changes when TCMB cannot be reached
  • check_circle Turkish messages in a Turkish admin, English otherwise

Technical details

A short technical summary for developers and system administrators.

Source
https://www.tcmb.gov.tr/kurlar/today.xml, downloaded with cURL when available and with allow_url_fopen otherwise. The connection is limited to 10 seconds and the whole request to 20 seconds.
Matching
Each rate is found by its CurrencyCode in the bulletin and divided by its Unit. Both TRY and TL are recognised as the Turkish lira. Currencies that move or are added in the bulletin do not affect the result.
Calculation
OpenCart value = TRY value of the default currency ÷ TRY value of the currency. The default currency is written as 1.00000 on every refresh.
Security
Connects to TCMB over HTTPS with certificate verification on. The refresh runs only for users allowed to modify the Currencies screen. Database updates go through OpenCart’s own query layer.
Changed files
On OpenCart 2 and on OpenCart 3 up to 3.0.3, only admin/model/localisation/currency.php and admin/controller/localisation/currency.php change through OCMOD; core files on disk stay untouched. On OpenCart 3.0.4 and later the extension runs from its own extension/currency files, and on OpenCart 4 from its own extension/e5octcmb folder, changing no core file.
Language
When the admin language code starts with tr (tr, tr-tr), messages are in Turkish; otherwise they are in English. The OpenCart 3 and 4 packages ship with en-gb and tr-tr language files.

Frequently asked questions

The questions we hear most about E5 OC TCMB Exchange Rates, answered.

What does E5 OC TCMB Exchange Rates do?

It connects OpenCart’s currency refresh to the daily TCMB exchange rate bulletin. Whenever you press the refresh button or an automatic update runs, every currency in your store is updated with TCMB rates.

Which OpenCart versions does it support?

OpenCart 2.1.0.x–2.3.0.x, 3.0.0.0–3.0.5.1 and 4.0.2.x–4.1.0.4. There is a separate package for each major version; install the one that matches your store. OpenCart 4.0.0 and 4.0.1 are not supported.

Which rate is used?

The banknote selling rate. When TCMB publishes no banknote rate for a currency, such as the Russian rouble, the forex selling rate is used.

When are rates updated?

When you press the refresh button on the Currencies screen, and whenever OpenCart runs its own currency refresh, for example when you add a currency. On OpenCart 4 the daily currency cron job, and on OpenCart 3.0.4 and later the extension’s cron command, update rates by themselves. TCMB publishes the bulletin on business days in the afternoon; at weekends you get the last business day’s rates.

What happens to a currency TCMB does not publish?

Its value stays the same and it is listed separately in the refresh message. If your default currency is not in the bulletin, no rate is changed and a warning is shown.

I use another TCMB exchange rate extension. What should I do?

On OpenCart 2 or on OpenCart 3 up to 3.0.3, remove the old extension under Extensions → Modifications first, then install this package and refresh the list. Both change the same lines, so they cannot run together. On OpenCart 3.0.4 and later and on OpenCart 4, only the one you select as the currency rate engine is used. Older extensions that read rates by their position in the bulletin can write the wrong rate when TCMB adds a currency; this one reads rates by code.

What happens if I uninstall it?

On OpenCart 2 and on OpenCart 3 up to 3.0.3, delete it under Extensions → Modifications and refresh the list, and OpenCart’s own currency refresh comes back. On OpenCart 3.0.4 and later and on OpenCart 4, switch the currency rate engine back to ECB and uninstall the extension. It adds no database tables; your current rate values stay as they are.

Custom development

Let’s tailor this plugin to your site

We can extend E5 OC TCMB Exchange Rates for your site’s specific needs: a new feature, a different workflow, or an integration with another system you use. Tell us what you need and we will plan it with you. We only charge for the extra time we actually put in, and small 10–15 minute jobs are on us.