In WooCommerce, how can I get all orders of a single customer with a user id? Also I want to get order number of each orders of that particular user.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
wc_get_orders
function to get orders from WooCommerce. Try the following code to retrieve orders from a specific user.You will get 10 recent orders of a customer by using this code. If you want to get all orders, then you can change limit to “-1” as
limit => -1
. But it is not recommended to use limit “-1” as it may lead to performance issue if your site has large number of orders.