1

I need to separate products in one Order into two. While I dividing them, I need to put a particular product with his shipping item to another order. I have no idea how to get products from shipping item. Or maybe there is a case when you can get a shipping item from the product in Order?

foreach ( $this->order->get_items( 'shipping' ) as $item_id => $shipping_item_obj ) { 
    // need to get products from $shipping_item_obj
}
LoicTheAztec
  • 207,510
  • 22
  • 296
  • 340
Igonaf
  • 23
  • 5
  • For info: You **can not** get Products from `WC_Order_Item_Shipping` as products are involved in another kind of order items: `WC_Order_Item_Product`. So the Order shipping items are not directly related to Order line items (Products). – LoicTheAztec Sep 03 '19 at 20:01

0 Answers0