Is your WooCommerce shop_order post type no showing any results? All you may need is to add a post_status into your loop’s arguments.
1 answers
1
Add post_status into your loop's arguments
In order to display WooCommerce orders, you need to set post_status to wc-processing, in order to show processing orders.
$args = array(
'post_type' => 'shop_order',
'post_status' => 'wc-processing'
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
//Do stuff
endwhile;
wp_reset_postdata();
Note, you can also set post_status to any or array_keys( wc_get_order_statuses() ), in order to display all WooCommerce shop orders.
However, for example, in order to get multiple, yet selective, types of orders, you can set this to array( ‘wc-completed’, ‘wc-processing’ ).
— Support WizardAnswer 1