閱讀341 返回首頁    go 阿裏雲 go 技術社區[雲棲]


magento -- 通過Shipment Code找到Order信息

Shipment是EAV模型,默認不會選出order_id信息,因此需要使用使用addAttributeToSelect方法,代碼如下: 

 

$collection = Mage::getModel('sales/order_shipment')->getCollection()->addAttributeToSelect('order_id')->addAttributeToFilter('increment_id', '100000002'); foreach($collection AS $c) { echo 'Order Id : ' . $c->getOrder()->getId(); break; }  

 

出處:https://koda.javaeye.com/blog/639987

最後更新:2017-04-02 05:21:03

  上一篇:go magento開發 -- 修改當前用戶的客戶組
  下一篇:go magento -- Magento事件一覽表