Update (For WooCommerce 3+). Now for the code you can use WC_Order_Item_Product (and WC_Product ) methods instead, like:
In that scenario, you can “get” the order object with the wc_get_order WooCommerce function. It's also possible to gain $order information if you ...
This ended up being the solution: function jdr_qty_sold_by_product_id( $ product_id ) { global $wpdb; $data ...
Order Items in code. Get. Let's begin with WC_Order's get_items() that returns all products
Here you have All material to build your own function. Below this is an example with a function that will get the product quantity in an order ...
Problem: I have a View of WooCommerce Orders that shows the products in each order. I would also like to show the quantity of each product.
Get parent order object. get_order_id() : int: Get order ID this meta belongs to. get_quantity() : int: Get quantity. get_tax_class() ...
Minimum Order Qty – Customer must purchase no less than this quantity of items to checkout.
I'm looking to fetch only that specific quantity refunded. If you have an order of 5 of the same item and refund 1 my function returns 1, if you then ...
Product Quantity: Quantities will be totaled based on the Product ID.