__( 'Year', 'woocommerce' ),
'last_month' => __( 'Last Month', 'woocommerce' ),
'month' => __( 'This Month', 'woocommerce' ),
);
$current_range = ! empty( $_GET['range'] ) ? sanitize_text_field( $_GET['range'] ) : 'last_month';
if ( ! in_array( $current_range, array( 'custom', 'year', 'last_month', 'month', '7day' ) ) ) {
$current_range = 'last_month';
}
$this->calculate_current_range( $current_range );
$hide_sidebar = true;
include( WC()->plugin_path() . '/includes/admin/views/html-report-by-date.php');
}
/**
* Get the main chart
*
* @return string
*/
public function get_main_chart() {
$tax_rows = $this->get_order_report_data( array(
'data' => array(
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax_amount'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax_amount'
),
'_order_total' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_sales'
),
'_order_shipping' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping'
),
'ID' => array(
'type' => 'post_data',
'function' => 'COUNT',
'name' => 'total_orders',
'distinct' => true,
),
'post_date' => array(
'type' => 'post_data',
'function' => '',
'name' => 'post_date'
),
),
'group_by' => $this->group_by_query,
'order_by' => 'post_date ASC',
'query_type' => 'get_results',
'filter_range' => true
) );
?>
|
|
" href="#">[?] |
" href="#">[?] |
[?] |
" href="#">[?] |
total_sales - $tax_row->total_shipping;
$total_tax = $tax_row->tax_amount + $tax_row->shipping_tax_amount;
?>
chart_groupby == 'month' )
echo date_i18n( 'F', strtotime( $tax_row->post_date ) );
else
echo date_i18n( get_option( 'date_format' ), strtotime( $tax_row->post_date ) );
?> |
total_orders; ?> |
|
total_shipping ); ?> |
|
|
|
|
|
|
|
|
|