Page 1 of 1
Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Mon Sep 02, 2024 3:38 am
by HAO
I understand using the services provided by
ECB Data Portal, But we used New Taiwan Dollar as our main currency and found some error messages:
Code: Select all
Notice: Undefined index: TWD in admin/model/extension/currency/ecb.php on line 54
Warning: Division by zero in admin/model/extension/currency/ecb.php on line 54
Does anyone know how to solve this problem?
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Mon Sep 02, 2024 5:24 pm
by ADD Creative
Check you currency codes are correct.
To prevent the error when no default currency. In admin/model/extension/currency/ecb.php change.
To.
Code: Select all
if (isset($currencies[$default])) {
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Mon Sep 02, 2024 9:16 pm
by HAO
New Taiwan Dollar's currency code is TWD, But I still get an error message:
Notice: Undefined variable: default in admin/model/extension/currency/ecb.php on line 41
Code: Select all
if (isset($currencies[$default])) {
Notice: Undefined variable: default in admin/model/extension/currency/ecb.php on line 59
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Mon Sep 02, 2024 9:58 pm
by ADD Creative
TWD in not in the list returned by
https://www.ecb.europa.eu/stats/eurofxr ... -daily.xml so you can't use that currency updater.
Correct fix for the error when default currency not in ECB list.
https://github.com/opencart/opencart/pull/14112
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Tue Sep 03, 2024 8:39 pm
by HAO
Thank you for your help!
This means that even if I use your modification method on github, it will not work properly, right?
Because when I change the EUR in the code to TWD, new exchange rate data is generated, But the exchange rate is obviously abnormal.
This is the current exchange rate of the New Taiwan Dollar:
1 TWD = 0.030931 USD
1 TWD = 0.023261 GBP
1 TWD = 0.027793 EUR
But judging from the screenshots, it’s obviously not normal.
Does this mean that OpenCart officials must develop a new Currency Rate Engine to allow other currency to be used?
If so, how do I set the USD exchange rate for PayPal?
Because I don’t know how to set the USD exchange rate used by Card Currency Value, Can you tell me how to set it up?
Thank you!
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Tue Sep 03, 2024 9:11 pm
by by mona
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Tue Sep 03, 2024 9:35 pm
by JNeuhoff
It would indeed require another currency rates extension to be implemented for OpenCart. There are a number of APIs (both free and paid-for ones) for getting currency rates, see e.g.
https://nordicapis.com/10-apis-for-curr ... nge-rates/
Perhaps it may make sense to add support for some of them, such as for the
https://fixer.io/, but the free APIs usually only support a limited number of API requests, unlike paid plans.
Or maybe this one could be used for OpenCart:
https://github.com/fawazahmed0/exchange-api , it claims to be a free API with no usage limit.
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Tue Sep 03, 2024 10:16 pm
by HAO
The PayPal payment module and currency conversion engine I discussed are all built-in functions of OpenCart 3.0.4.0.
I want to ask how to set it up correctly, Am I wrong?
The new PayPal payment module is completely different from the old setting interface.
What are you talking about?
If there are many users from non-USD currency countries who encounter the same problem as me.
OpenCart officials should help us prepare another currency conversion engine module.
The new version of PayPal payment module should also teach us how to set it up, Because the setting method is different from the past.
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Tue Sep 03, 2024 10:39 pm
by JNeuhoff
As said, the built-in currency rates engine in OpenCart 3.0.4.0 uses the ECB API which doesn't support the TWD. You'd have to disable this currency rates engine, and then manually edit your currency rates. Or get a developer to implement another currency rates API in OC 3.0.4.0. I was just thinking about backporting the fixer.io currency engine from OpenCart 4 to OpenCart 3, but so far there hasn't been much of a demand for it.
As regards PayPal Standard: I don't know whether that one still work in the latest OC 3.0.4.0. The latter now uses the PayPal Integration payment extension.
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Wed Sep 04, 2024 8:22 am
by HAO
JNeuhoff wrote: ↑Tue Sep 03, 2024 10:39 pm
As said, the built-in currency rates engine in OpenCart 3.0.4.0 uses the ECB API which doesn't support the TWD. You'd have to disable this currency rates engine, and then manually edit your currency rates. Or get a developer to implement another currency rates API in OC 3.0.4.0. I was just thinking about backporting the fixer.io currency engine from OpenCart 4 to OpenCart 3, but so far there hasn't been much of a demand for it.
As regards PayPal Standard: I don't know whether that one still work in the latest OC 3.0.4.0. The latter now uses the PayPal Integration payment extension.
I know to disable the "ECB", But like I said "Currency Rate Engine" this is a new feature in 3.0.4.0, and the default European Central Bank Currency Converter cannot be used, so is there a possible solution next? (My main point is to confirm this with OpenCart officials)
The same PayPal Standard has been replaced by the PayPal Integration payment extension, Due to the special environment of PayPal in Taiwan, we are unable to use TWD to pay in TWD to stores in Taiwan through PayPal, So for the PayPal Integration payment extension I don't know how to set it up.
Can't I confirm this?
Re: Currency Rate Engine: European Central Bank Currency Converter Bug on OpenCart 3.0.4.0
Posted: Wed Sep 04, 2024 5:45 pm
by ADD Creative
You are probably best to use the get support option on the PayPal extension page for official support.
https://www.opencart.com/index.php?rout ... n_id=38358