Magento: Create shipment from order

18. November 2010 at 15:35

You want to create a shipment from an order?
here is the solution in php (example with invoice-data) :

$order = Mage::getModel('sales/order')->loadByIncrementId($invoice->getOrder()->getIncrementId());
if($order->canShip())
{
 $_itemQty                 = $order->getItemsCollection()->count();
 $_shipment             = Mage::getModel('sales/service_order', $order);
 $_shipment             = new Mage_Sales_Model_Order_Shipment_Api();
 $_shipmentId         = $_shipment->create($order->getIncrementId());
}
GD Star Rating
loading...
GD Star Rating
loading...
Magento: Create shipment from order, 10.0 out of 10 based on 1 rating