Query WooCommerce orders grouped by several order statuses


As I can see from WooCommerce documentation, WC_Order_Query allows only one single order status to be passed as query parameter. Has anyone find some workaround to allow querying several order statuses in the same query?

Let’s say I want to query orders with “completed” AND “refunded” status.

How can this be done via standard WC_Order_Query class?

Example from doc:

// Get orders on hold.
$args = array(
    'status' => 'on-hold',

$orders = wc_get_orders( $args );

Link to wc_order_query() and WC_Order_Query WooCommerce documentation

Aleksandar Mitic 2 months 0 Answers 10 views 0

Leave an answer