overbags Posted September 9, 2017 Share Posted September 9, 2017 (edited) Hello I just updated to version 1.6.1.17 and the stats in the control panel have disappeared. in the statistics module everything works fine only in the control panel do not work I attach some picture to make me understand better Edited October 23, 2017 by overbags (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted September 9, 2017 Share Posted September 9, 2017 I noted the same but after inserting one new order, the statistics re-appeared. I am guessing the stats are set to zero during the update and then need recalculation. You might also try to reset the dashboard stats / trends module. Link to comment Share on other sites More sharing options...
overbags Posted September 10, 2017 Author Share Posted September 10, 2017 thank you very much for your advice Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 good morning I tried what you advised me, statistics now start from 07/09/2017. previous sales are not displayed Link to comment Share on other sites More sharing options...
Scully Posted September 11, 2017 Share Posted September 11, 2017 To track it down is quickly looked at the getTotalSales in AdminStatsController. This function - as just one example - executes this kind of SQL: $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT LEFT(`date_upd`, 10) as date, SUM(total_paid_tax_excl / o.conversion_rate) as sales FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_state` os ON o.current_state = os.id_order_state WHERE `date_upd` BETWEEN "'.pSQL($date_from).' 00:00:00" AND "'.pSQL($date_to).' 23:59:59" AND os.logable = 1 AND os.paid = 1 '.Shop::addSqlRestriction(false, 'o').' GROUP BY LEFT(`date_upd`, 10)'); If might check your order states table with the column logable. These is one condition for order states to show up in the statistics. Which means: order state must contain 1 in field os_logable and the order must have been paid. Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 I'm not very practical about queries ... in what table I find the os_logable field Link to comment Share on other sites More sharing options...
Scully Posted September 11, 2017 Share Posted September 11, 2017 The field name is logable and the table name is ps_order_state. Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 thank you so much ... I checked ... logable is 1 and orders are paid but the problem is not resolved Link to comment Share on other sites More sharing options...
Scully Posted September 11, 2017 Share Posted September 11, 2017 Also note date_upd is the field for last updated time for an order. If your order(s) haven't been updated in the time range selected, they won't shop up as well. If you consider the stats as bug, open a forge request - which is the correct way of sending error requests to the PrestaShop Team. Link to comment Share on other sites More sharing options...
idnovate.com Posted September 11, 2017 Share Posted September 11, 2017 Enable option Set the order as paid. in your final order statuses. Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 I have reset version 1.6.1.16 statistics on this release work well all orders over a year have been paid, delivered and invoiced but version 1.6.1.17 only displays statistics only from the last update onwards. Link to comment Share on other sites More sharing options...
idnovate.com Posted September 11, 2017 Share Posted September 11, 2017 I have reset version 1.6.1.16 statistics on this release work well all orders over a year have been paid, delivered and invoiced but version 1.6.1.17 only displays statistics only from the last update onwards. Enable option Set the order as paid. in your final order statuses. 1 Link to comment Share on other sites More sharing options...
Scully Posted September 11, 2017 Share Posted September 11, 2017 Sounds good. The answer from overbags on paid status was very general. But yes, it should be ticked on the final order state. Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 Ok! I got it in the final status "delivered" I have to activate "paid order" later update to 1.6.1.17 and let you know. Link to comment Share on other sites More sharing options...
Scully Posted September 11, 2017 Share Posted September 11, 2017 I quote myself: Also note date_upd is the field for last updated time for an order. This was an change with newer prestashop releases. At least up to 1.6.1.13 the date was checked against invoice_date. Now it is checked against last updated field. If you wish to get the old behavior, you have to change the AdminStatsController.php or try to use the one from a previous version. Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 ok Link to comment Share on other sites More sharing options...
overbags Posted September 11, 2017 Author Share Posted September 11, 2017 ok ... so it works fine ... thanks a lot to everyone .... but it would be better if the date for the statistics was used to create the order .... do I have to be "solved"? Link to comment Share on other sites More sharing options...
Scully Posted September 11, 2017 Share Posted September 11, 2017 You have to be "solved" if you have ... 1) tested and older version of the controller file which works according your wish OR 2) you take your existing controller file and replace all SQL selects which use date_upd with invoice_date OR 3) you place forge request Link to comment Share on other sites More sharing options...
overbags Posted September 12, 2017 Author Share Posted September 12, 2017 could you tell me the files to edit? Link to comment Share on other sites More sharing options...
Scully Posted September 12, 2017 Share Posted September 12, 2017 Read my post # 5. Link to comment Share on other sites More sharing options...
overbags Posted September 12, 2017 Author Share Posted September 12, 2017 AdminStatsController.php ok thanks ... done Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now