bos Posted October 9, 2016 Share Posted October 9, 2016 I installed CubeCart in May 2015 as a testing site, but never actually started selling objects until August 2016. In the Dashboard, I see "Sales statistics 2015-2016". But as I never sold anything earlier, those statistics are a bit redundant. Question: Is it possible to wipe all stats up to, and including, July 2016? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 9, 2016 Share Posted October 9, 2016 If the orders are inconsequential, then I am confident that deleting them will get you what you want. (The following may depend on what version of CubeCart you have installed.) In admin, Orders, begin checking the checkboxes in the left-most column for those orders you have decided to delete (one page at a time). Then, at the bottom of the list, "With selected:", choose "Failed Fraud Review. This removes the order from any kind of calculation and possibly adds the inventory back into the stock levels. It should not send out an email to the customer. That should remove them from the stats. But you may also want, for "then", choose Delete. Quote Link to comment Share on other sites More sharing options...
bos Posted October 10, 2016 Author Share Posted October 10, 2016 The thing is, there are no orders prior 2016-09-14, yet somehow 2015 (the year Cubecart was installed) appears in the diagram. Attaching pictures for clarity. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 10, 2016 Share Posted October 10, 2016 Yes, CubeCart uses Google Charts, which has some apparent restrictions. It seems that the data array must have values and must have the same number of columns for each row. Now, if it can be determined that an entire year has not had any sales, we can add code to suppress including the "prior year" chart data. I should be able to figure out the code to do that. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 11, 2016 Share Posted October 11, 2016 In the file /admin/sources/dashboard.index.inc.php: Find near line 156: $this_year = date('Y'); $last_year = $this_year - 1; $chart_data['data'] = "['Month', '$this_year', '$last_year'],"; for ($month = 1; $month <= 12; $month++) { $m = date("M", mktime(0, 0, 0, $month, 10)); $last_year_month = (isset($data[$last_year][$m]) && $data[$last_year][$m]>0) ? $data[$last_year][$m] : 0; $this_year_month = (isset($data[$this_year][$m]) && $data[$this_year][$m]>0) ? $data[$this_year][$m] : 0; $chart_data['data'] .= "['$m', $this_year_month, $last_year_month],"; } $chart_data['title'] = $lang['dashboard']['title_sales_stats'].': '.$last_year.' - '.$this_year; $GLOBALS['smarty']->assign('CHART', $chart_data); Change to: $this_year = date('Y'); $last_year = $this_year - 1; $last_year_ignore = (!count($data[$last_year])) ? true : false ; $chart_data['data'] = "['Month', '$this_year'" . ( ($last_year_ignore) ? "" : ", '$last_year'" ) . "],"; for ($month = 1; $month <= 12; $month++) { $m = date("M", mktime(0, 0, 0, $month, 10)); $last_year_month = (isset($data[$last_year][$m]) && $data[$last_year][$m]>0) ? $data[$last_year][$m] : 0; $this_year_month = (isset($data[$this_year][$m]) && $data[$this_year][$m]>0) ? $data[$this_year][$m] : 0; $chart_data['data'] .= "['$m', $this_year_month" . ( ($last_year_ignore) ? "" : ", $last_year_month" ) . "],"; } $chart_data['title'] = $lang['dashboard']['title_sales_stats'].': '. (($last_year_ignore) ? "" : $last_year.' - ') .$this_year; $GLOBALS['smarty']->assign('CHART', $chart_data); This adds a variable that is used to ignore last year if last year has no sales. 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.