To get the User ID from the Order ID, you can use many ways, Here are 2 of them: In WooCommerce 3.0+ you can use WC_Order Class ...
The only thing I'm missing is getting the *user_id*. How can I get the user (in detail: the id), from my WooCommerce Order? code: function ...
Or maybe the order ID, customer ID, billing info, payment method, total refunds and so on…
Try belo: In WooCommerce 2.5, use get_post_meta() function this way: $user_id = get_post_meta($order_id, '_customer_user', true);.
Get current user ID, find ID by username, email, first and last names, get WooCommerce customer from an order and other examples.
Any User ID set for a customer will not be respected on creation. The ID column can ...
There are several reasons you might want to get all WooCommerce orders for a customer in your shop.
ID = oitem.order_id. LEFT JOIN ' . $wpdb->base_prefix . 'postmeta as ometa ON ometa.post_id = oinfo.ID AND ometa.meta_key = "_customer_user". LEFT JOIN ...
As you may know, some of the standard WordPress user fields
WC_Abstract_Order::get_user_id Get user ID. Used by orders, not other order types like refunds. woocommerce.