I want to get the quantity to ship when i click on submit shipment botton. Following is the image and the array i got.

enter image description here


$qtyShipped = $this->getRequest()->getParam('shipment');

It gives output as

array(2) { ["items"]=> array(1) { [31]=> string(1) "3" } ["comment_text"]=> string(0) "" }

value 31 is changing for each order. Please help me to solve this.


1 Answer 1


Table Name sales_order_item -> Field Name: qty_shipped or sales_shipment -> total_qty for that Magento\Sales\Model\Order\Shipment & getTotalQty

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_order = $objectManager->get('Magento\Sales\Model\Order\Item')->load(<id>);
$getQtyShipped =  $_order->getQtyShipped();
  • Let me know if any issue @NitinPawar. Thanks
    – Jackson
    Dec 9, 2016 at 7:26
  • Yes u can user this value. Because it's already in DB. So get & Update if u Want then Save it again. @NitinPawar
    – Jackson
    Dec 9, 2016 at 7:37
  • No i think you not getting my question, i want to update the qty to ship value to 3 and it is 1 before. so when i access it from the database it will give me 1. Dec 9, 2016 at 7:44
  • I think u need to set Shipment Quantity Value in Observer on Some Event llike when clicked on "Ship" button from Admin Right?
    – Jackson
    Dec 9, 2016 at 8:03
  • yes. I want to use this quantity when i ship the product. Dec 9, 2016 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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