3
以编程方式创建发货
我遇到了多种以编程方式创建货运的方式。他们是 //Type 1 $converter=Mage::getModel('sales/convert_order'); $shipment=$converter->toShipment($order); // snip //Type 2 $shipment = Mage::getModel('sales/service_order', $order) ->prepareShipment($this->_getItemQtys($order)); // snip //Type 3 $shipment = Mage::getModel('sales/service_order', $order)->prepareShipment($itemQty); $shipment = new Mage_Sales_Model_Order_Shipment_Api(); $shipmentId = $shipment->create($orderId); // snip 这三种方法之间有什么区别。在这三种方法中,这是创建货件和添加跟踪号的正确方法。