Get orders of a specific customer woocommerce


I want to get the orders of a specific customer based on their ID, no matter what the current status of order is, I just want to retrieve it.
I’m trying with the below method, but it always returns empty array.
I already made sure that this customer have some orders with completed status.

function getOrderOfUser(){
//      'customer_id'=>22,
//  var_dump($orders);
    return $orders;

Any help will be highly appreciated.

, Lint 4 months 0 Answers 45 views 0

Leave an answer