Last active
October 9, 2018 14:30
-
-
Save plugin-republic/10b70cfa44309744c232777747bbd0ee to your computer and use it in GitHub Desktop.
Use WC_Order_Query to query WooCommerce orders
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
<?php | |
$args = array( | |
'limit' => 9999, | |
'return' => 'ids', | |
'date_completed' => '2018-10-01...2018-10-10', | |
'status' => 'completed' | |
); | |
$query = new WC_Order_Query( $args ); | |
$orders = $query->get_orders(); | |
foreach( $orders as $order_id ) { | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment