Skip to main content
added 160 characters in body
Source Link
Fra
  • 7k
  • 12
  • 65
  • 99

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()

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) {
    $item->getShipment();
}

if this doesn't work, you need to load the shipment based on the $item->getParentId()

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 $shipment_item) {
     if ($shipment_id = $shipment_item->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()

edited body
Source Link
Fra
  • 7k
  • 12
  • 65
  • 99

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(), 'order_item_id');
foreach ($shipmentItems as $item) {
    $item->getShipment();
}

if this doesn't work, you need to load the shipment based on the $item->getParentId()

If you have the $orderItem, you can easily get all the ShipmentItems:

$shipmentItems = Mage::getResourceModel('sales/order_shipment_item_collection')
    ->addFieldToFilter($orderItem->getId(), 'order_item_id');
foreach ($shipmentItems as $item) {
    $item->getShipment();
}

if this doesn't work, you need to load the shipment based on the $item->getParentId()

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) {
    $item->getShipment();
}

if this doesn't work, you need to load the shipment based on the $item->getParentId()

Source Link
Fabian Blechschmidt
  • 35.4k
  • 8
  • 75
  • 182

If you have the $orderItem, you can easily get all the ShipmentItems:

$shipmentItems = Mage::getResourceModel('sales/order_shipment_item_collection')
    ->addFieldToFilter($orderItem->getId(), 'order_item_id');
foreach ($shipmentItems as $item) {
    $item->getShipment();
}

if this doesn't work, you need to load the shipment based on the $item->getParentId()