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());
}
Daniel Briegert

Daniel Briegert

xing: https://www.xing.com/profile/Daniel_Briegert

More Posts - Website

Follow Me:
TwitterFacebook