How to find out which item belong to which package (shipping)
-
Hi
I have an order ID. I want to find get the packages of the order and which items are included in each package.
For example, my order has 3 items and 2 packages. One of the 2 packages contains 2 items and the other one has 1 item.
I have this WC_Order instance
$order = new WC_Order( $orderId );
I can get the packages using the get_shipping_methods method
$order->get_shipping_methods()
I can get the items of the order the same way with get_items
$order->get_items()
But there is no information between the items and the shipping methods.
I’m currently developing a shipping method plugin. Does my plugin has to do the job while saving the order or is there a standard way to do this ?
- The topic ‘How to find out which item belong to which package (shipping)’ is closed to new replies.