Good Day, I'm trying to get the list of recent active orders by a user, order ID and get the status of each of the active order in woocommerce, then print out any update in status of any of the orders. I have searched around for clues or snippet that would help me achieve this, but couldn't find one.
I was able to get how to count the number of order (using the below snippet)
$current_user = wp_get_current_user();
$numorders = wc_get_customer_order_count( $current_user->ID );
After searching on various blogs, i was able to this;
$order = wc_get_order( $order_id );
$order->get_status()
I'm really clueless how to combine this to print out the desired result (which is to have a list of notification update of any of the recent order(s) by a user.
The Goal of this is to create something like a mini order notification system where the result will look something like this;
Your ORDER NOTIFICATION
=> Your order with ID #24555 is being completed - 15-01-2019
=> Your order with ID #24234 is being completed - 13-01-2019
=> Your order with ID #24555 has been shipped - 10-01-2019
=> Your order with ID #24234 has been shipped - 10-01-2019
=> Your order with ID #12324 is being processed - 09-01-2019
[Maximum of 10 notification]
Thanks