Search code examples
magentomagento-1.4magento-1.5

How to Display Best Sellers dynamic specific category?


how to display Best sellers dynmaic and specific category in magento 1.6.2.0 ?


Solution

  • To display Bestseller you can load the collection of products from resource model reports like below

    $products = Mage::getResourceModel('reports/product_collection')
                ->addOrderedQty()
                ->addAttributeToSelect(array('name', 'price', 'small_image', 'short_description', 'description')) //edit to suit tastes
                ->setStoreId($storeId)
                ->addStoreFilter($storeId)
                ->setOrder('ordered_qty', 'desc'); //best sellers on top
    

    and to load them category wise you can get the current category or pass it harcoded. and just you need to filter the product in that category.