keat Posted June 6, 2018 Share Posted June 6, 2018 On one of my sites I can see sales statistics, but in another I can't. The graph appears, but shows no sales, unless I edit the database and change all the orders from processing to completed. Is there a setting somewhere which switches this feature on, or did I maybe do a code edit on the site which works. The only difference I can see, the site which works has email notify at processing, the one which dosn't has email notify at pending. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2018 Share Posted June 6, 2018 There are two queries that are asking for orders that are at Completed. These queries are used to show Total and Average Sales, but are not involved in the graph. In admin /sources/dashboard.index.inc.php: Find near line 161: $total_sales = $GLOBALS['db']->query('SELECT SUM(`total`) as `total_sales` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_order_summary` WHERE `status` = 3;'); Change to: $total_sales = $GLOBALS['db']->query('SELECT SUM(`total`) as `total_sales` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_order_summary` WHERE `status` IN(2,3);'); Find near line 164: $ave_order = $GLOBALS['db']->query('SELECT AVG(`total`) as `ave_order` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_order_summary` WHERE `status` = 3;'); Change to: $ave_order = $GLOBALS['db']->query('SELECT AVG(`total`) as `ave_order` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_order_summary` WHERE `status` IN(2,3);'); Near line 185 is where the sales data is queried for the chart and that query does ask for Processing and Completed orders. Quote Link to comment Share on other sites More sharing options...
keat Posted June 18, 2018 Author Share Posted June 18, 2018 I believe I may have done this before, but only on one site. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.