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