Query to display best selling product

0
26
views
Advertisement

$storeId = Mage::app()->getStore()->getId();

$products = Mage::getResourceModel(‘reports/product_collection’)
->addOrderedQty()
->addAttributeToSelect(‘*’)
->addStoreFilter($storeId)
->setOrder(‘ordered_qty’, ‘desc’)
->load(); //best sellers on top