Page 1 of 1

[SOLVED] Dashboard Percentages gone negative 250 - 300%

Posted: Thu Sep 29, 2022 2:38 pm
by jrr
How does the dashboard generate the percentages?

My Total Orders, Total Sales, & Total Customers are all correct, but the percentages for each box are wrong with Total Orders showing -300%, Total Sales -250%, and Total Customer also at -300%.

Also the World Map doesn't show any sales.

I have OC 3.0.3.6, running on PHP 7.3.33. This has been working for a couple of years, and I double checked admin permissions in the Users section were enabled for Dashboard.

I have done a bit of cleaning up (purging some bulky log files), and haven't looked at the Dashboard for a little while - so may have deleted some important file I shouldn't have.

Thanks!

Re: Dashboard Percentages gone negative 250 - 300%

Posted: Thu Sep 29, 2022 6:48 pm
by ADD Creative
They are generated by dividing the total order in the database by the values in the statistics.

What do you see under Reports - > Statistics? Can you refresh them?

Re: Dashboard Percentages gone negative 250 - 300%

Posted: Thu Sep 29, 2022 8:46 pm
by jrr
ADD Creative wrote:
Thu Sep 29, 2022 6:48 pm
They are generated by dividing the total order in the database by the values in the statistics.

What do you see under Reports - > Statistics? Can you refresh them?
I tried Refreshing the Statistics - no change:

Image

This is what I saw on the dashboard (Canada now shows 2 sales):
Image

Today the stats are slowly recovering as we get sales (World Map has gone back to no sales anywhere):
Image

Thanks for your time!

Re: Dashboard Percentages gone negative 250 - 300%

Posted: Thu Sep 29, 2022 11:39 pm
by ADD Creative
Sorry, I misread you post and thought you were talking about the percentages in the sidebar.

The box percentage is calculated form ('yesterday's orders' - 'the day before yesterday's orders') / 'yesterday's orders'. So if you have more orders the day before yesterday than yesterday, you will get a negative number. I think!

Re: Dashboard Percentages gone negative 250 - 300%

Posted: Mon Oct 03, 2022 10:31 pm
by jrr
Further to my question on how statistics are generated in the Dashboard - does anyone know how the Dashboard World Map gets its data to show sales by countries? Mine is now ignoring sales and shows just the basic map, and mousing over the countries does not show sales, just the country's name.
I can ignore it of course, but I assume because it is not working that something is broken and needs attention.
I don't see any errors that might be related in the logs...

Thanks!

Re: Dashboard Percentages gone negative 250 - 300%

Posted: Mon Oct 03, 2022 10:45 pm
by ADD Creative
It uses getTotalOrdersByCountry in admin/model/extension/dashboard/map.php. The order status needs to be tick as one the completed order statuses in your settings. The SQL query groups all order by country.

Re: Dashboard Percentages gone negative 250 - 300%

Posted: Sat Oct 08, 2022 3:29 pm
by jrr
ADD Creative wrote:
Mon Oct 03, 2022 10:45 pm
It uses getTotalOrdersByCountry in admin/model/extension/dashboard/map.php. The order status needs to be tick as one the completed order statuses in your settings. The SQL query groups all order by country.
Ah, thanks! I see that when I go to admin/System/Settings/(store name)/Option/Complete Order Status and select "Processed" & "Shipped" & "(any choice we use to indicate sale is finished/shipped/picked up/...)" that the data now appears in World Map. Problem solved!

You know the little question mark explanation isn't much use as it says something like - Status Reached where customer can download product - doesn't say anything about how this is actually used.