Get product order history


/ Published in: PHP
Save to your folder(s)

List all orders related to a product id


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.