• Good morning,

    I want to find all subscriptions of a customer using WC_Order_Query. For some reason, when a subscription is set to Active the subscription is not returned by the following query:

                // Get the current users subscriptions
                $query = new WC_Order_Query( array(
                    'type' => 'shop_subscription',
                    'customer_id' => get_current_user_id(),
                    'orderby' => 'date',
                    'order' => 'DESC',
                ) );
                $orders = $query->get_orders();	

    When I set the subscription to On Hold, the subscription is returned by the query. I don’t apply any filtering in the query, so what causes this issue?

    Thanks in advance,

    Bèrke

  • The topic ‘Active subscriptions not returned by WC_Order_Query’ is closed to new replies.