Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

give a list of orders based on product sku, product description
 
svendewaele
Jr. Member
 
Total Posts:  5
Joined:  2010-03-22
 

Hi,

I want to find all orders which have a certain product in it. So i want to do a search on the orders based on product sku, product description…

 
Magento Community Magento Community
Magento Community
Magento Community
 
krasilich
Magento Team
 
Avatar
Total Posts:  14
Joined:  2010-03-21
Kiev
 

$itemCollection Mage::getModel('sales/order_item')->getCollection();
$itemCollection->addFieldToFilter('sku', array('eq' => 'sample_sku'));
$itemCollection->load();

foreach(
$itemCollection as $item{
    
echo $item->getOrderId();
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top