Friday, April 20, 2012

Retrieve bestsellers

Here is how you can retrieve a list of bestsellers
$collection = Mage::getResourceModel('sales/report_bestsellers_collection')
            ->addStoreFilter(Mage::app()->getStore()->getId())//if you want the bestsellers for a specific store view. if you want global values remove this
            ->setPageSize(5)//se there the number of products you want returned
foreach ($collection as $_product){
    $realProduct = Mage::getModel('catalog/product')->load($_product->getProductId());
    //do something with $realProduct;
Make sure you refresehd the statistic for bestsellers. Reports->Refresh statistics. Select refresh lifetime statistics for bestsellers. Enjoy.


  1. Hey there,

    I wish there was a contact-me button but I couldnt find it.
    Im wondering if you can help me with magento?
    Im struggling to install some purchased plugins (same error).
    if you can contact me at sandrine at ziller com au

    1. if you want to contact me, leave a comment with your e-mail address (I won't publish it) and I will send you an e-mail.


  2. Why use a contact me button, simple use a comment form and allow user comment but 1st you approve it than it's show live, so it's a great and totally free of cost..

    Magento Plugins