Posted By

neofreko on 04/25/11


Tagged

magento


Versions (?)

Get product order history


 / Published in: PHP
 

List all orders related to a product id

  1. $quotes= Mage::getResourceModel('sales/order_collection')
  2. ->join('order_item', 'entity_id=order_id')
  3. ->addFieldToFilter('main_table.store_id', array('eq' => 5))
  4. ->addFieldToFilter('order_item.product_id', array('eq' => $argv[1]))
  5.  
  6. ;

Report this snippet  

You need to login to post a comment.