Updates: 2017 - SQL query changed to "SELECT DISTINCT" instead of "SELECT " to avoid duplicated Order IDs in the array (then no need of ...
Get All orders IDs for a given product ID. *. * @param integer $product_id ( required). * @param array $order_status (optional) Default is 'wc-completed'.
WooCommerce 3.0+. you can get the order items of an order by $order = wc_get_order( $order_id ); $items = $order->get_items();. then if you loop through the ...
Woocommerce get orders by product ID. GitHub Gist: instantly share code, notes, and snippets.
The [products] shortcode allows you to display products by post ID, SKU, categories, attributes ...
Or maybe the order ID, customer ID, billing info, payment method, total
All product orders require processing, except those that only contain products
In this case, you have to find a way to “get the $product object from $product_id” – you find this example below. Other examples might be the order or the cart ...
You can specify the callback using the ?_jsonp parameter for GET requests to have
The product ID is stored as meta for an Order's items; wp_posts > wp_woocommerce_order_items > wp_woocommerce_order_itemmeta .