阅读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事件一览表