Fixed sales data in API so it matches the WC reports page.

Fixes #7233
This commit is contained in:
Barry Kooij 2015-01-30 14:28:35 +01:00
parent 242dbe1bc0
commit 746a46778d
1 changed files with 15 additions and 12 deletions

View File

@ -88,29 +88,32 @@ class WC_API_Reports extends WC_API_Resource {
'_order_total' => array( '_order_total' => array(
'type' => 'meta', 'type' => 'meta',
'function' => 'SUM', 'function' => 'SUM',
'name' => 'sales' 'name' => 'total_sales'
),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'tax'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'shipping_tax'
), ),
'_order_shipping' => array( '_order_shipping' => array(
'type' => 'meta', 'type' => 'meta',
'function' => 'SUM', 'function' => 'SUM',
'name' => 'shipping' 'name' => 'total_shipping'
), ),
'_order_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_tax'
),
'_order_shipping_tax' => array(
'type' => 'meta',
'function' => 'SUM',
'name' => 'total_shipping_tax'
),
'ID' => array( 'ID' => array(
'type' => 'post_data', 'type' => 'post_data',
'function' => 'COUNT', 'function' => 'COUNT',
'name' => 'order_count' 'name' => 'order_count'
) )
), ),
'order_types' => wc_get_order_types( 'sales-reports' ),
'order_status' => array( 'completed', 'processing', 'on-hold', 'refunded' ),
'filter_range' => true, 'filter_range' => true,
) ); ) );