The API might have changed since the original question, but this is a lot more elegant and uses WC's own functions: $args = array( ...
Let's get our current user: $customer = wp_get_current_user();. And determine what number of orders indicates a “loyal” customer: $loyal_count = ...
I want to get all order amounts and the payment date of orders made by current user inside a plugin. I'm using this code, it currently prints order ...
When you begin a bulk export or export items from the Orders or Users lists,
... object you're in business. Here's how to get all the order information:
If you are using PayPal and orders are staying in Pending, you may have an
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,.
Learn about the WooCommerce user roles and which permissions to give your
By default, it's set to 15 (use -1 to display all orders.) Args: array( 'current_user' => '' ) [woocommerce_my_account]. Current user argument is automatically set ...
In fact, almost all "magic methods" have been removed and directly accessing object properties will throw PHP warnings. $order = wc_get_order( ...