Page 1 of 1

order_info.tpl Undefined variable: totals

Posted: Wed May 20, 2015 8:06 pm
by yowchuan

Code: Select all

Notice: Undefined variable: totals in mydomain/public/admin/view/template/sale/order_info.tpl on line 337
Warning: Invalid argument supplied for foreach() in mydomain/public/admin/view/template/sale/order_info.tpl on line 337
I am getting the above errors, not on all but on some of the 'Missing Orders'.

These 'Missing Orders' doesn't have the following info:
Customer name
E-mail
Telephone
Total is always zero.

But they have the following info:
Order ID
Store Name
Store URL
User Agent
Date Added
Date Modified

Nothing in the 'Payment Details' tab.

The error above also appears in the 'Product' tab. And there's no product details either.

I am on OC 2.0.2.0 and latest Journal theme.

I would like to think it's a Journal issue, but I have the same environment on other stores, and no such problems.

Re: order_info.tpl Undefined variable: totals

Posted: Fri May 22, 2015 6:46 pm
by pm-netti
yowchuan wrote:

Code: Select all

Notice: Undefined variable: totals in mydomain/public/admin/view/template/sale/order_info.tpl on line 337
Warning: Invalid argument supplied for foreach() in mydomain/public/admin/view/template/sale/order_info.tpl on line 337
I am getting the above errors, not on all but on some of the 'Missing Orders'.

These 'Missing Orders' doesn't have the following info:
Customer name
E-mail
Telephone
Total is always zero.

But they have the following info:
Order ID
Store Name
Store URL
User Agent
Date Added
Date Modified

Nothing in the 'Payment Details' tab.

The error above also appears in the 'Product' tab. And there's no product details either.

I am on OC 2.0.2.0 and latest Journal theme.

I would like to think it's a Journal issue, but I have the same environment on other stores, and no such problems.
You can change first admin/controller/sale/order.php in line 906:

Code: Select all

public function info() {
to:

Code: Select all

public function info() {
$data['totals'] = array();

Re: order_info.tpl Undefined variable: totals

Posted: Fri May 22, 2015 9:56 pm
by yowchuan
Thanks pm-netti!
I have done that, basically just adding that line

Code: Select all

$data['totals'] = array();
to the function.

I will update again.

Thanks.

Re: order_info.tpl Undefined variable: totals

Posted: Fri May 22, 2015 10:59 pm
by JNeuhoff
Well spotted, I have added it to github.

Re: order_info.tpl Undefined variable: totals

Posted: Sat May 23, 2015 12:17 am
by pm-netti
yowchuan wrote: I am getting the above errors, not on all but on some of the 'Missing Orders'.

These 'Missing Orders' doesn't have the following info:
Customer name
E-mail
Telephone
Total is always zero.

But they have the following info:
Order ID
Store Name
Store URL
User Agent
Date Added
Date Modified.
I understand you correctly, you have another problem, the orders can not be found?

Re: order_info.tpl Undefined variable: totals

Posted: Tue May 26, 2015 4:55 pm
by yowchuan
pm-netti wrote: I understand you correctly, you have another problem, the orders can not be found?
Adding the following line seems to have eradicated the issue of those zero total orders, further observation is required.

Code: Select all

$data['totals'] = array();
As for what you've mentioned about orders cannot be found, these orders are automatically categorized under 'Missing Orders' which is OpenCart's default category of orders not checked out (abandoned carts).