Last active
July 27, 2018 13:53
-
-
Save sarathlal-old/22a003f3965eaae40b3fe6b32812c36c to your computer and use it in GitHub Desktop.
Get WoCommerce orders of a specific customer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$customer_id = get_current_user_id(); | |
$customer_orders = get_posts( array( | |
'numberposts' => -1, | |
'meta_key' => '_customer_user', | |
'meta_value' => $customer_id, | |
'post_type' => wc_get_order_types(), | |
'post_status' => array_keys( wc_get_order_statuses() ), | |
//'post_status' => array('wc-completed'), | |
) ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment