Post by ndim_pro » Thu Dec 05, 2019 9:54 pm

Opencart version 3.0.3.1
Currency enabled: Only EURO

I keep getting the following error and my error.log file is full of it. It becomes huge in size and I face disk capacity issues. The fix could be to set a cron job and delete it periodically or disable error logging. But the right solution is to find out why it is generated such an error. Could someone help me here?

PHP Notice: Undefined index: in /public_html/system/library/cart/currency.php on line 25,26, 27, 30

The code on these lines are the following:

Code: Select all

24 public function format($number, $currency, $value = '', $format = true) {
25		$symbol_left = $this->currencies[$currency]['symbol_left'];
26		$symbol_right = $this->currencies[$currency]['symbol_right'];
27              $decimal_place = $this->currencies[$currency]['decimal_place'];
28
29  	        if (!$value) {
30		$value = $this->currencies[$currency]['value'];
31           }
...

User avatar
New member

Posts

Joined
Fri Nov 04, 2016 4:49 pm

Post by Johnathan » Thu Dec 05, 2019 10:56 pm

The problem is probably not the currency library itself, but whatever code is using it and is not passing correct parameters. First double-check all your currencies and their codes in System > Localisation > Currencies, to make sure they're all correct. Also make sure the conversion values are correct.

After that, see if you can figure out when it triggers. If it's on every page load, it may be a mod that hooks into the header or footer files, so check out your ocMod files to see if anything affects those. If it uses the currency library, it should have this code in it:

Code: Select all

$this->currency

If you can't narrow it down after that, you may need to hire someone to diagnose what's going on. If you need to find a developer, you can post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by ndim_pro » Thu Dec 05, 2019 11:39 pm

Johnathan wrote:
Thu Dec 05, 2019 10:56 pm
The problem is probably not the currency library itself, but whatever code is using it and is not passing correct parameters. First double-check all your currencies and their codes in System > Localisation > Currencies, to make sure they're all correct. Also make sure the conversion values are correct.

After that, see if you can figure out when it triggers. If it's on every page load, it may be a mod that hooks into the header or footer files, so check out your ocMod files to see if anything affects those. If it uses the currency library, it should have this code in it:

Code: Select all

$this->currency

If you can't narrow it down after that, you may need to hire someone to diagnose what's going on. If you need to find a developer, you can post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.
I use a lot of modifications. I will try to check them one by one and post the results here.

User avatar
New member

Posts

Joined
Fri Nov 04, 2016 4:49 pm
Who is online

Users browsing this forum: No registered users and 9 guests