Add compat for status count as well.
This commit is contained in:
parent
00530cce42
commit
b2f7599647
|
@ -384,9 +384,8 @@ class WC_Tracker {
|
|||
*/
|
||||
private static function get_order_counts() {
|
||||
$order_count = array();
|
||||
$order_count_data = wp_count_posts( 'shop_order' );
|
||||
foreach ( wc_get_order_statuses() as $status_slug => $status_name ) {
|
||||
$order_count[ $status_slug ] = $order_count_data->{ $status_slug };
|
||||
$order_count[ $status_slug ] = wc_orders_count( $status_slug );
|
||||
}
|
||||
return $order_count;
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ class WC_Tracker_Test extends \WC_Unit_Test_Case {
|
|||
|
||||
$order_data = WC_Tracker::get_tracking_data()['orders'];
|
||||
|
||||
print_r( $order_data );
|
||||
foreach ( $status_entries as $status_entry ) {
|
||||
$this->assertEquals( $order_count / count( $status_entries ), $order_data[ $status_entry ] );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue