• Magento

    Programmatically create Shipment of a new order in magento

    Programmatically create Shipment of a new order in magento Programmatically create Shipment of a new order in magento For some time need to create Shipment of an order.I have write code for how to create Shipment of an order pragmatically here First of all load an order by order id, Check all item of an order are already creating Shipment. if ,invoice is not created then create Shipment of all items Step1 ::load order by order id $order=Mage::getModel(‘sales/order’)->load($orderId); Or $order = Mage::getModel(‘sales/order’)->loadByIncrementId($orderIncrementId); Step2: check a item is available for shipment and set quantity for shipment $qty=array(); $Itemqty = $eachOrderItem->getQtyOrdered() – $eachOrderItem->getQtyShipped() – $eachOrderItem->getQtyRefunded() – $eachOrderItem->getQtyCanceled(); $qty[$eachOrderItem->getId()]=$Itemqty; Step3:create a shipment and…