Page 1 of 2
Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sat Dec 23, 2017 10:54 pm
by gazn0357
After install/upgrade to 3.0.2.0, the Orders Processing/Orders Completed/Order Statuses report at bottom of Admin Navigation Panel all show 0%. Looking for solution. Dan
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sat Dec 23, 2017 11:16 pm
by straightlight
If you do not use the master files of Opencart v3.0.2.0 at this time already, see if the following file replacement will rectify the issue:
https://github.com/opencart/opencart/bl ... n_left.php
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun Dec 24, 2017 12:41 am
by gazn0357
Other than changes I have made to the /catalog/view/theme/default/stylesheet/stylesheet.css file, there have been no code changes to files since original install. I do have three extensions installed, but did disabled them to see if they were cause. Do not believe they are.
Replaced file with file in link provided, but see no differences. Did do a file comparison between the two and surprisingly see many changes between files. Debating now if I should go back to original file.
Under Store Options, I have the 'Processing order Status' set to Processing and the 'Complete Order Status' set to Completed.
Dan
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun Dec 24, 2017 1:02 am
by straightlight
See with the master files from Github Opencart if you can replicate the same issue.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun Dec 24, 2017 3:36 am
by gazn0357
Are you saying to download all the master files (done that) and then FTP files over current Admin directory?
Are all configuration settings in the sql database?
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun Dec 24, 2017 3:53 am
by straightlight
Are you saying to download all the master files (done that)
Yes
and then FTP files over current Admin directory?
No, rather in the host file manager console where you could simply extract the files with one simple click, which around 2400 files will be extracted in matter of seconds, instead of waiting an hour over FTP and also ensures full integrity of the files rather than corrupted / missing files during the upload for your admin folder.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Wed Mar 14, 2018 1:25 am
by anddi
I am having the exact same issue on 3.0.2.0. I tried the "column_left.php" from the github master branch, I noticed it had been indeed updated but that alone did not fix the problem for me.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Fri Jun 01, 2018 10:33 am
by gazn0357
Still looking for an answer.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Fri Jun 08, 2018 3:33 am
by PetjeNL
I just upgraded to 3.0.2.0 and experiencing the same issue.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sat Jun 16, 2018 5:20 pm
by BillK
Here's what I've found so far with this issue:
The statistics/addOrderHistory() function shows that it should be triggered by the model/checkout/order/addOrderHistory/
before event, but the trigger is set to model/checkout/order/addOrderHistory/
after.
It is getting triggered after the order is already saved, so when the function checks if the new order_status_id is different from the saved order_status_id it doesn't do anything because it thinks that order status didn't change.
After updating the the statistics_order_history row in oc_event and changing the trigger to catalog/model/checkout/order/addOrderHistory/before, I then had to change the addOrderHistory function in catalog/controller/event/statistics.php from
Code: Select all
public function addOrderHistory(&$route, &$args, &$output) {
to
Code: Select all
public function addOrderHistory(&$route, &$args) {
It's still buggy but at least its updating the oc_statistics table now. If I get it working better I will post my updates here.
Thanks
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun Oct 07, 2018 9:39 pm
by salimalisalim
Hi, I am facing the same issue, Is there any update on this bug ?
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Mon Oct 08, 2018 6:32 pm
by straightlight
The provided solution above has already been posted on GitHub Opencart.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Fri Oct 19, 2018 10:31 am
by Marinelife
BillK wrote: ↑Sat Jun 16, 2018 5:20 pm
Here's what I've found so far with this issue:
The statistics/addOrderHistory() function shows that it should be triggered by the model/checkout/order/addOrderHistory/
before event, but the trigger is set to model/checkout/order/addOrderHistory/
after.
It is getting triggered after the order is already saved, so when the function checks if the new order_status_id is different from the saved order_status_id it doesn't do anything because it thinks that order status didn't change.
After updating the the statistics_order_history row in oc_event and changing the trigger to catalog/model/checkout/order/addOrderHistory/before, I then had to change the addOrderHistory function in catalog/controller/event/statistics.php from
Code: Select all
public function addOrderHistory(&$route, &$args, &$output) {
to
Code: Select all
public function addOrderHistory(&$route, &$args) {
It's still buggy but at least its updating the oc_statistics table now. If I get it working better I will post my updates here.
Thanks
I have followed this fix but unfortunately it's still not working in my store.
How can i fix it

Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Fri Oct 19, 2018 5:10 pm
by countzer0
For anyone applying this fix, you'll want to update the oc_statistics table with the order_status counts. You can get these using the following query:
Code: Select all
SELECT o.order_status_id, COUNT( o.order_status_id ) AS total, os.name
FROM oc_order o
LEFT JOIN oc_order_status os ON ( o.order_status_id = os.order_status_id )
GROUP BY o.order_status_id
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun Oct 21, 2018 1:12 am
by straightlight
countzer0 wrote: ↑Fri Oct 19, 2018 5:10 pm
For anyone applying this fix, you'll want to update the oc_statistics table with the order_status counts. You can get these using the following query:
Code: Select all
SELECT o.order_status_id, COUNT( o.order_status_id ) AS total, os.name
FROM oc_order o
LEFT JOIN oc_order_status os ON ( o.order_status_id = os.order_status_id )
GROUP BY o.order_status_id
This one might be more reliable since
order is a reserved term. This issue was already encountered before.
Code: Select all
SELECT o.order_status_id, COUNT(o.order_status_id) AS total, os.name
FROM `" . DB_PREFIX . "order` o
LEFT JOIN `" . DB_PREFIX . "order_status` os ON (o.order_status_id = os.order_status_id)
GROUP BY o.order_status_id
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sat May 11, 2019 8:37 pm
by samaraki
The instructions are super unclear....
"After updating the the statistics_order_history row in oc_event and changing the trigger to catalog/model/checkout/order/addOrderHistory/before, I then had to change the addOrderHistory function in catalog/controller/event/statistics.php from
"
This implies two instructions.
1. catalog/model/checkout/order/addOrderHistory/before (There is no such directory)
There is however: catalog/model/checkout/order and on this page there is 3 instances of "addOrderHistory" But there is no mention of "after" word in the file to change to "before" So not sure what to do here.
2. The second instruction was easy enough.
3. The 3rd instruction:
SELECT o.order_status_id, COUNT(o.order_status_id) AS total, os.name
FROM `" . DB_PREFIX . "order` o
LEFT JOIN `" . DB_PREFIX . "order_status` os ON (o.order_status_id = os.order_status_id)
GROUP BY o.order_status_id LIMIT 0, 25
This results in this error:
#1146 - Table 'mytable" . DB_PREFIX . "order' doesn't exist
So for me this "fix" fixes nothing.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sat May 11, 2019 9:48 pm
by straightlight
#1146 - Table ' mytable" . DB_PREFIX . "order' doesn't exist
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun May 12, 2019 1:25 pm
by samaraki
Yes, I renamed it to "mytable" as I didn't want to share my datebase name.
I pasted your code into the SQL
#1146 - Table 'XXXXXXX (I've not pasted it here for security reasons)" . DB_PREFIX . "order' doesn't exist
What I'm saying is, the code:
SELECT o.order_status_id, COUNT(o.order_status_id) AS total, os.name
FROM `" . DB_PREFIX . "order` o
LEFT JOIN `" . DB_PREFIX . "order_status` os ON (o.order_status_id = os.order_status_id)
GROUP BY o.order_status_id LIMIT 0, 25
Doesn't work.
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Sun May 12, 2019 2:17 pm
by letxobnav
are you running this query:
Code: Select all
SELECT o.order_status_id, COUNT(o.order_status_id) AS total, os.name
FROM `" . DB_PREFIX . "order` o
LEFT JOIN `" . DB_PREFIX . "order_status` os ON (o.order_status_id = os.order_status_id)
GROUP BY o.order_status_id LIMIT 0, 25
with phpmyadmin and not via php?
Re: Orders Processing/Orders Completed/Order Statuses showing 0%
Posted: Tue May 14, 2019 3:01 am
by gjburg
Same for me after upgrade from 2.3.0.2 to 3.0.3.2
Replaced the latest GIT
https://github.com/opencart/opencart/bl ... _left.php[
https://github.com/opencart/opencart/bl ... istics.php
Changed the Table Events
Code: Select all
statistics_order_history changed to catalog/model/checkout/order/addOrderHistory/before
Manual changed the code in statistics.php
Code: Select all
public function addOrderHistory(&$route, &$args) {
Ran SQL script
Code: Select all
SELECT o.order_status_id, COUNT( o.order_status_id ) AS total, os.name
FROM oc_order o
LEFT JOIN oc_order_status os ON ( o.order_status_id = os.order_status_id )
GROUP BY o.order_status_id
Any ideas to get this to work?