Getting the correct variation price from order items in Woocommerce 3
问题 Im trying to get the correct price for each item variation however it only seems to be getting the first price of that product variation. Not sure how to solve this. Code: $query = new WC_Order_Query( array( 'status' => 'on-hold', 'orderby' => 'date', 'order' => 'DESC', 'return' => 'ids', ) ); $order_ids = $query->get_orders(); foreach( $order_ids as $order_id ) { $order = new WC_Order($order_id); foreach ($order->get_items() as $item_id => $item_obj) { $_product = wc_get_product($item_obj[