If you have the $orderItem
, you can easily get all the ShipmentItems:
$shipmentItems = Mage::getResourceModel('sales/order_shipment_item_collection')
->addFieldToFilter('order_item_id', $orderItem->getId());
foreach ($shipmentItems as $item$shipment_item) {
$item if ($shipment_id = $shipment_item->getShipment>getParentId()) {
$shipment = Mage::getModel('sales/order_shipment')->load($shipment_id);
}
}
if this doesn't work, you need to load the shipment based on the $item->getParentId()