It's possible to get the total items count bought by the current customer in the past 30 days. Here is the code of this function based on this ...
// Display "completed" orders count $statuses = ['completed']; $orders = wc_get_orders( ['limit' => -1, 'status' => $statuses] ); echo '
' . sprintf( __('Count of "%s" ...
Failed, pending, and canceled orders which get cleaned up will be moved to the trash.
In this case, you can use the WooCommerce Order Status Control extension to get greater control over when paid orders are automatically completed.
The WooCommerce Order Status Control extension gives you control over which types of paid orders should be automatically placed in Completed status.
Order statuses (processing, completed, etc), are post statuses, so you can't just used 'publish'. You also don't want to hard-code the core ...
found this code but it wont show quantities… function items_count() { function get_purchased_products() { $products = array(); // Get all customer orders ...
... for orders. Here's an example of how to query completed orders by date:
I've spent half a day trying to get this working properly. If you want to detect a WooCommerce order being completed in your plugin or theme so as to take an ...