Post by HAO » Mon Sep 02, 2024 3:38 am

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?

HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Mon Sep 02, 2024 5:24 pm

Check you currency codes are correct.

To prevent the error when no default currency. In admin/model/extension/currency/ecb.php change.

Code: Select all

if ($currencies) {
To.

Code: Select all

if (isset($currencies[$default])) {

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Mon Sep 02, 2024 9:16 pm

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

Attachments

Screenshot 2024-09-02 at 21-16-19 Currencies.png

Screenshot 2024-09-02 at 21-16-19 Currencies.png (94.59 KiB) Viewed 614 times


HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Mon Sep 02, 2024 9:58 pm

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

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by HAO » Tue Sep 03, 2024 8:39 pm

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!

Attachments

Screenshot 2024-09-03 at 20-37-22 PayPal Checkout Integration.png

Screenshot 2024-09-03 at 20-37-22 PayPal Checkout Integration.png (73.47 KiB) Viewed 513 times

Screenshot 2024-09-03 at 20-24-42 Currencies.png

Screenshot 2024-09-03 at 20-24-42 Currencies.png (99.56 KiB) Viewed 513 times


HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by by mona » Tue Sep 03, 2024 9:11 pm

It might be an idea to try to separate your understanding between Opencart and not Opencart

PayPal is not Opencart
https://www.paypal.com/us/cshelp/articl ... al-help116

The currency converter is not Opencart
https://www.opencart.com/index.php?rout ... n_id=34800
https://www.opencart.com/index.php?rout ... 20exchange

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by JNeuhoff » Tue Sep 03, 2024 9:35 pm

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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by HAO » Tue Sep 03, 2024 10:16 pm

by mona wrote:
Tue Sep 03, 2024 9:11 pm
It might be an idea to try to separate your understanding between Opencart and not Opencart

PayPal is not Opencart
https://www.paypal.com/us/cshelp/articl ... al-help116

The currency converter is not Opencart
https://www.opencart.com/index.php?rout ... n_id=34800
https://www.opencart.com/index.php?rout ... 20exchange
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.

Attachments

Screenshot 2024-09-03 at 22-07-24 PayPal Payments Standard.png

Screenshot 2024-09-03 at 22-07-24 PayPal Payments Standard.png (48.46 KiB) Viewed 476 times


HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by JNeuhoff » 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.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by HAO » Wed Sep 04, 2024 8:22 am

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?

Attachments

Screenshot 2024-09-04 at 08-11-34 Extensions.png

Screenshot 2024-09-04 at 08-11-34 Extensions.png (164.48 KiB) Viewed 403 times


HAO
Active Member

Posts

Joined
Fri Jun 03, 2011 2:52 pm

Post by ADD Creative » Wed Sep 04, 2024 5:45 pm

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

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 1 guest