Skip to main content
3 of 3
added tag for version
Ronak Chauhan
  • 6.2k
  • 2
  • 30
  • 66

How to get the shipment number of an order item?

Once an order is placed, I programmatically generate associated shipments (because of different manufacturing time on my products)

I can then have for a single order several associated shipments:

ex:

  • Shipment #100000110 in 2 days for items 1 and 2
  • Shipment #100000111 in 5 days for item 3

I would like to access the shipment number associated to specific item :

something like :

$order = Mage::getModel('sales/order')->load($_order_id);
$_items = $order->getAllItems();

foreach ($_items as $_item)
{
    $ciid = $_item->getId();
    $shipmentNbr = $_item->getShipment()->getIncrementId();
    ...
}

Thank your for your help,

Alexglvr
  • 1.7k
  • 1
  • 28
  • 56