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?


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


Just to add on how to debug it by your own. The PHP function called get_class_methods() will always be your friend.

echo "<pre>";
echo "</pre>";
  • This. This right here should be included within every Magento related SO question. – Matthew Colley Dec 5 '19 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.