Automattic\WooCommerce\Admin\API\Reports\Categories

DataStore::assign_report_columns()protectedWC 1.0

Assign report columns once full table name has been assigned.

Method of the class: DataStore{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->assign_report_columns();

DataStore::assign_report_columns() code WC 8.7.0

protected function assign_report_columns() {
	$table_name           = self::get_db_table_name();
	$this->report_columns = array(
		'items_sold'     => 'SUM(product_qty) as items_sold',
		'net_revenue'    => 'SUM(product_net_revenue) AS net_revenue',
		'orders_count'   => "COUNT(DISTINCT {$table_name}.order_id) as orders_count",
		'products_count' => "COUNT(DISTINCT {$table_name}.product_id) as products_count",
	);
}