WC_Admin_Dashboard::get_sales_report_data()privateWC 1.0

Get sales report data.

{} It's a method of the class: WC_Admin_Dashboard{}

No Hooks.

Return

Object.

Usage

// private - for code of main (parent) class only
$result = $this->get_sales_report_data();

Code of WC_Admin_Dashboard::get_sales_report_data() WC 6.7.0

private function get_sales_report_data() {
	include_once dirname( __FILE__ ) . '/reports/class-wc-report-sales-by-date.php';

	$sales_by_date                 = new WC_Report_Sales_By_Date();
	$sales_by_date->start_date     = strtotime( gmdate( 'Y-m-01', current_time( 'timestamp' ) ) );
	$sales_by_date->end_date       = strtotime( gmdate( 'Y-m-d', current_time( 'timestamp' ) ) );
	$sales_by_date->chart_groupby  = 'day';
	$sales_by_date->group_by_query = 'YEAR(posts.post_date), MONTH(posts.post_date), DAY(posts.post_date)';

	return $sales_by_date->get_report_data();
}