WooCommerce get order by user email

WooCommerce get order by user email

Today we talk about WooCommerce or WordPress get an order by user email programmatically. In this tutorial, We focus on how to get user orders by using the user email.

Let’s start with our example.

 $orderArg = array(
    'customer' => $email,
    'limit' => -1,
    );
$orders = wc_get_orders($orderArg);
if($orders){
  foreach ($orders as  $orderData) {
                print_r($orderData);
         }
}

Search

Recent Blogs

Categories

Archives

Archives

Tags