After updating Woocommerce from 2.6.13 to 3.2.6 some custom code that displays pending orders and tallies up the products ordered no longer works. I am having trouble porting the code over as the woocommerce docs I have been locating appear to be out of date.
For example, I don't think this is valid anymore but I can't find the updated version
$orders = get_posts( array(
'post_type' => 'shop_order',
'post_status' => array( 'wc-processing', 'wc-completed' )
) );
I had updated it from the one below but neither are returning anything in the array
$orders = get_posts( array(
'post_type' => 'shop_order',
'post_status' => 'publish',
'tax_query' => array( array(
'taxonomy' => 'shop_order_status',
'field' => 'slug',
'terms' => array( 'processing', 'completed' )
) )
) );
What is the proper way to get orders using get_posts from woocommerce in 3.0+?