Add order counts by status
This commit is contained in:
parent
0aee0a0848
commit
1a6835019a
|
@ -390,6 +390,8 @@ class WC_Tracker {
|
|||
$status = $order->get_status();
|
||||
|
||||
if ( 'shop_order' == $type ) {
|
||||
|
||||
// Find the first and last order dates for completed and processing statuses
|
||||
if ( "completed" == $status and $date_created < $first ) {
|
||||
$first = $date_created;
|
||||
}
|
||||
|
@ -402,6 +404,15 @@ class WC_Tracker {
|
|||
if ( "processing" == $status and $date_created > $processing_last ) {
|
||||
$processing_last = $date_created;
|
||||
}
|
||||
|
||||
// Get order counts by status
|
||||
$status = "wc-" . $status;
|
||||
|
||||
if ( ! isset( $order_data[ $status ] ) ) {
|
||||
$order_data[ $status ] = 1;
|
||||
} else {
|
||||
$order_data[ $status ] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$order_data['first'] = gmdate( 'Y-m-d H:i:s', $first );
|
||||
|
|
Loading…
Reference in New Issue