Class WC_Admin_Report

Admin Report

Extended by reports to show charts and stats in admin.

Direct known subclasses

WC_Report_Coupon_Usage, WC_Report_Customers, WC_Report_Sales_By_Category, WC_Report_Sales_By_Date, WC_Report_Sales_By_Product, WC_Report_Taxes_By_Code, WC_Report_Taxes_By_Date

Package: WooCommerce\Admin\Reports
Category: Admin
Author: WooThemes
Version: 2.1.0
Located at includes/admin/reports/class-wc-admin-report.php

Methods summary

public array|string
# get_order_report_data( array $args = array() )

Get report totals such as order totals and discount amounts.

Get report totals such as order totals and discount amounts.

Data example:

'_order_total' => array( 'type' => 'meta', 'function' => 'SUM', 'name' => 'total_sales' )

Parameters

$args
array
$args

Returns

array|string
depending on query_type
public string
# prepare_chart_data( array $data, string $date_key, string $data_key, integer $interval, string $start_date, string $group_by )

Put data with post_date's into an array of times

Put data with post_date's into an array of times

Parameters

$data
array
$data array of your data
$date_key
string
$date_key key for the 'date' field. e.g. 'post_date'
$data_key
string
$data_key key for the data you are charting
$interval
integer
$interval
$start_date
string
$start_date
$group_by
string
$group_by

Returns

string
public string
# sales_sparkline( integer $id = '', integer $days = 7, string $type = 'sales' )

Prepares a sparkline to show sales in the last X days

Prepares a sparkline to show sales in the last X days

Parameters

$id
integer
$id ID of the product to show. Blank to get all orders.
$days
integer
$days Days of stats to get.
$type
string
$type Type of sparkline to get. Ignored if ID is not set.

Returns

string
public
# calculate_current_range( string $current_range )

Get the current range and calculate the start and end dates

Get the current range and calculate the start and end dates

Parameters

$current_range
string
$current_range
public string
# get_main_chart( )

Get the main chart

Get the main chart

Returns

string
public array
# get_chart_legend( )

Get the legend for the main chart sidebar

Get the legend for the main chart sidebar

Returns

array
public array
# get_chart_widgets( )

[get_chart_widgets description]

[get_chart_widgets description]

Returns

array
public
# get_export_button( )

Get an export link if needed

Get an export link if needed

public
# output_report( )

Output the report

Output the report

Magic methods summary

Properties summary

public mixed $chart_interval
#
public mixed $group_by_query
#
public mixed $barwidth
#
public mixed $chart_groupby
#
public mixed $start_date
#
public mixed $end_date
#
WooCommerce API documentation generated by ApiGen 2.8.0