Magento 1.9 – Get Product-Wise Sold Quantity

magento-1.9

I'm exporting Magento products data for a non-Magento site. In this new site, I need to display product-wise sold quantity.

Eg. 23 sold out of 50

With Magento products table, I can get product current quantity. To fulfill my above need, I need another quantity which may be product original quantity or product sold quantity at this stage. I was not able to find an answer for my exact problem.

I guess this is something really simple. However I need some help and I don't have any Magento experience.

Best Answer

This will give you ordered qty in collection. you can create custom file to export data this way to get ordered qty of products.

$products = Mage::getResourceModel('reports/product_collection')
       ->addOrderedQty()
       ->setOrder('ordered_qty', 'desc');

foreach ($products as $_product)
{
   print_r($_product->getData());
}