C
C
Concencuc2020-06-09 19:54:16
opencart
Concencuc, 2020-06-09 19:54:16

How to add auto-change of the exchange rate for the National Bank of Belarus in opencart?

How is it implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mikhail, 2020-06-09
@Concencuc

If you do not find a ready-made module, then in the simplest case:
1) Write a simple php script that receives the exchange rate and writes it to the database
2) Add this script to the CRON task (to automatically update the exchange rate daily)
OR
1) Correct the file admin/model/localisation/currency.php (Opencart 3) for your bank
Tips:
1) You can get the rate either via API (preferably), or parse the page, getting it using curl or even file_get_contents()
2) If I'm not mistaken, then the API of the National Bank - https://www.nbrb.by/apihelp/exrates/sample
3) In the store's database, exchange rates are stored in the " oc_currency " table (Opencart 3)
4) The file that updates the exchange rate - admin/model/localization/currency.php (Opencart 3)

D
Dima Polos, 2020-06-09
@dimovich85

Look for the API of the National Bank, or the API of the exchange rate of the National Bank of Belarus.
Write a plugin or modifier for OC that will work with this API.
Alternatively, you can look for a ready-made plugin, maybe there is.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question