Post by supak111 » Tue May 21, 2019 4:26 am

Hi could anyone tell me what this error could mean?

Code: Select all

PHP Warning:  A non-numeric value encountered in /vqmod/vqcache/vq2-system_library_currency.php on line 119
here is system_library_currency.php line 106-120, this: return $value * ($to / $from); being line 119 in question

Code: Select all

	public function convert($value, $from, $to) {
		if (isset($this->currencies[$from])) {
			$from = $this->currencies[$from]['value'];
		} else {
			$from = 1;
		}

		if (isset($this->currencies[$to])) {
			$to = $this->currencies[$to]['value'];
		} else {
			$to = 1;
		}

		return $value * ($to / $from);
	}

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member
Online

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by IP_CAM » Tue May 21, 2019 6:07 am

Fixed Stripe checkout non-numeric value error
Single (not range) Subtotal value returns non-numeric value error, when currency is converted.


It's most likely related to PHP v.7.x, and some Themes and Extensions
seemengly had a Problem with that. Search Google for:
"non-numeric value" Opencart
And you have shown the Code above from the
Vq/Oc-Modded Cache Version File, and that makes no
sense, because that Code might have been changed
by some Extension, unknown to others ... :'(

Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by supak111 » Tue May 21, 2019 7:37 am

Ok so I disabled all VQmod extensions having anything to do with currency.php, and now I get:

Code: Select all

PHP Warning:  A non-numeric value encountered in /system/library/currency.php on line 114
here is the code from sys/lib/currncy.php lines 101-115 again: return $value * ($to / $from); being line 114 in question

Code: Select all

	public function convert($value, $from, $to) {
		if (isset($this->currencies[$from])) {
			$from = $this->currencies[$from]['value'];
		} else {
			$from = 1;
		}

		if (isset($this->currencies[$to])) {
			$to = $this->currencies[$to]['value'];
		} else {
			$to = 1;
		}

		return $value * ($to / $from);
	}

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member
Online

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by IP_CAM » Tue May 21, 2019 9:37 am

Well, that Code is still the same, up to OC-3, it must therefore
be something else, leading to that Error.
As a wild guess, did you already update your Code, to make
Currency Exchange Rate work ?
https://www.opencart.com/index.php?rout ... n_id=32694
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by supak111 » Tue May 21, 2019 4:38 pm

No I didn't add any extension to make the currency exchange work after yahoo stopped until just now. Perhaps it will stop happening now that I have an extension that makes it work again.

I can't even figure out when the error happens. If I go play around with the exchange on my front end I can't get the error to happen. Just happens at random times to random visitors, not sure which visitor nor why. Could it be browser dependent?

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member
Online

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by supak111 » Wed May 22, 2019 4:37 pm

For anyone in the future: I wasn't able to fix the issue on 7.2 php but lowering the php version in your cPanel to 7.0 seems to resolve the error.

.

~ OC 3.0.3.2 and OCmods only ~


User avatar
Active Member
Online

Posts

Joined
Fri Feb 13, 2015 12:09 pm

Post by IP_CAM » Thu May 23, 2019 6:52 am

Well, that might work, but PHP v.7.0x is already planned to be removed from
Servers again, and your Problem needs to be solved sooner or later anyway.
You better install the Currency Mod, as mentioned abobe, to find out, if it
then works, since that was a problem solver in another Topic of this Place.
Good Luck!
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 179 guests