Magento – Magento 2: get shipment collection by order

magento2ordersshipment

I try to add custom action for generate PDF file for merchant (marketplace), like in the backend (Shipment > Action > PDF Shipments).

enter image description here

Try to call function in the backend but it request shipments collection (location: Magento\Module-sales\Model\Order\Pdf\Shipment.php)

enter image description here

Right now I have order collection but don't know how to get shipment collection?

Best Answer

You can get shipment collection from order object like this : $order->getShipmentsCollection();

Related Topic