Jump to content

sales stats in dashboard


keat

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...