Below you can find the code which will give you an array with orders value date and id $customer = wp_get_current_user(); // Get all customer ...
There are several reasons you might want to get all WooCommerce orders for a customer in your shop.
Updated Added Compatibility with WooCommerce 3+ (January 2018). Here is the code that you will need to get all customer orders and to go ...
This would obviously depend on the context you need these order ids in, is it in a hook, on a page or in the admin panel and so on. But here is ...
The API might have changed since the original question, but this is a lot more elegant and uses WC's own functions: $args = array( ...
$user_id='CUSTOMER_USER_ID_HERE'; $customer_orders = get_posts( array( 'meta_key' => '_customer_user', 'meta_value' => $user_id, ' ...
Maximum order amount allowed when using the coupon. email_restrictions, array, List of email addresses that can use this coupon. used_by, array, List of user IDs ...
Or maybe the order ID, customer ID, billing info, payment method, total refunds and so on…
select. p.ID as order_id,. p.post_date,. max( CASE WHEN pm.meta_key = ' _billing_email' and p.ID = pm.post_id THEN pm.meta_value END ) as billing_email,.
LOOP THROUGH ORDERS AND GET PRODUCT IDS. if ( !