Post by Zoo3 » Fri Dec 13, 2019 1:17 pm

When I try to output the Shipping List in Sales, the following warning is displayed.

Code: Select all

Warning: A non-numeric value encountered in /MY-OPENCART-EXTERNAL-STORAGE/modification/admin/controller/sale/order.php on line 1829 
The code is below.

Code: Select all

$option_weight += $product_option_value_info['weight'];
The above is included in the following block.

Code: Select all

$product_option_value_info = $this->model_catalog_product->getProductOptionValue($product['product_id'], $option['product_option_value_id']);

if ($product_option_value_info) {
	if ($product_option_value_info['weight_prefix'] == '+') {
		$option_weight += $product_option_value_info['weight'];
		} elseif ($product_option_value_info['weight_prefix'] == '-') {
		$option_weight -= $product_option_value_info['weight'];
		}
	}
}
I looked at the weight of the product registration, but it wasn't wrong.
How can I avoid this warning?

---

CentOS6, PHP7.3 or PHP7.1, MySQL 5.6
Last edited by Zoo3 on Tue Dec 24, 2019 10:44 am, edited 1 time in total.

New member

Posts

Joined
Fri May 25, 2018 5:25 pm

Post by by mona » Fri Dec 13, 2019 1:35 pm


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 kestas » Fri Dec 13, 2019 1:42 pm

If you really know that there should be numeric value, this line :

Code: Select all

$option_weight += $product_option_value_info['weight'];
replace with:

Code: Select all

$option_weight += (float)$product_option_value_info['weight'];
But this is better to do not in modified file. You should change it in your core file using OCMOD. Because if you make changes in modified file, after you refresh modifications this warning appear again.

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by Zoo3 » Fri Dec 13, 2019 2:05 pm

by mona wrote:
Fri Dec 13, 2019 1:35 pm
try this
viewtopic.php?t=199151

Code: Select all

$option_weight = 0;
I no longer have the warning. What side effects do I set to this?

kestas wrote: replace with:

Code: Select all

$option_weight += (float)$product_option_value_info['weight'];
I didn't know how to change it with ocmod yet, so I changed the code directly.
It cannot be solved in that state.
Last edited by Zoo3 on Fri Dec 13, 2019 2:17 pm, edited 1 time in total.

New member

Posts

Joined
Fri May 25, 2018 5:25 pm

Post by kestas » Fri Dec 13, 2019 2:16 pm

if you made changes directly in

Code: Select all

/MY-OPENCART-EXTERNAL-STORAGE/modification/admin/controller/sale/order.php on line 1829 
do not refresh modifications to try if it works. Only clear cache in admin panel.

Custom OpenCart modules and solutions. You can write PM with additional questions... Extensions you can find here


Active Member

Posts

Joined
Tue Oct 12, 2010 2:23 am

Post by by mona » Fri Dec 13, 2019 6:10 pm

Zoo3 wrote:
Fri Dec 13, 2019 2:05 pm

Code: Select all

$option_weight = 0;
I no longer have the warning. What side effects do I set to this?
the option weight is defined as 0 and not empty.

***********************************************

Code: Select all

if ($product_option_value_info) {
replace with:

Code: Select all

if !empty($product_option_value_info['weight_prefix'])) {

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 paulfeakins » Mon Dec 16, 2019 6:30 pm

Zoo3 wrote:
Fri Dec 13, 2019 1:17 pm

Code: Select all

Warning: A non-numeric value encountered in /MY-OPENCART-EXTERNAL-STORAGE/modification/admin/controller/sale/order.php on line 1829 
That's a modified file so the problem is probably an extension, try disabling them one-by-one until the error disappears.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by Zoo3 » Tue Dec 24, 2019 10:43 am

paulfeakins wrote:
Mon Dec 16, 2019 6:30 pm
That's a modified file so the problem is probably an extension, try disabling them one-by-one until the error disappears.
I reverted the manually changed values and reinstalled the extension. This error has recurred.
I need "$option_weight = 0;".

Thanks.

New member

Posts

Joined
Fri May 25, 2018 5:25 pm
Who is online

Users browsing this forum: niagato, Semrush [Bot], thomas_1989 and 632 guests