17 use Magento\Sales\Model\ResourceModel\Order\Shipment\CollectionFactory as ShipmentCollectionFactory;
73 parent::__construct($context,
$filter);
86 $shipments = $this->shipmentCollectionFactory->create()->setOrderFilter([
'in' =>
$collection->getAllIds()]);
91 $labelContent =
$shipment->getShippingLabel();
93 $labelsContent[] = $labelContent;
98 if (!empty($labelsContent)) {
99 $outputPdf = $this->labelGenerator->combineLabelsPdf($labelsContent);
100 return $this->fileFactory->create(
101 'ShippingLabels.pdf',
102 $outputPdf->render(),
108 $this->messageManager->addError(
__(
'There are no shipping labels related to selected orders.'));
109 return $this->resultRedirectFactory->create()->setPath(
'sales/order/');
__construct(Context $context, Filter $filter, CollectionFactory $collectionFactory, FileFactory $fileFactory, LabelGenerator $labelGenerator, ShipmentCollectionFactory $shipmentCollectionFactory)
massAction(AbstractCollection $collection)
$shipmentCollectionFactory
foreach($order->getItems() as $orderItem) $shipment