我有一个 Magento 网站,它使用 thub 来更新订单状态和发货。但是一旦它被迁移到不同的服务器,api就会返回这个
**<?xml version="1.0" encoding="ISO-8859-1"?>
<RESPONSE Version="4.6"><Envelope><Command>UPDATEORDERSSHIPPINGSTATUS</Command><StatusCode>0</StatusCode><StatusMessage>All Ok</StatusMessage></Envelope><Orders><Order>
<HostOrderID>100016422</HostOrderID><LocalOrderID>22364</LocalOrderID>
<HostStatus>Failed</HostStatus><StatusMessage1>Can not create Invoice</StatusMessage1><StatusMessage2>Filed create Invoice</StatusMessage2><StatusMessage3>Error. Not object shipment.</StatusMessage3></Order></Orders></RESPONSE>**
据我了解有问题的代码如下
代码 1:
if (!$this->_current_order->canInvoice()) {
// Added Track and Content
$this->Msg[] = 'Can not create Invoice';
return false;
}
代码 2:
$_shipments=$this->_current_order->getShipmentsCollection();
$shipments_array=$_shipments->toarray();
if (count($_shipments)==0){
$this->Msg[] = 'Error. Not object shipment.';
$this->result = 'Failed';
return false;
}
将 reset() for Mage::getModel("sales/order"); 解决了这个问题?