$collection = Mage::getResourceModel('sales/report_bestsellers_collection') ->setModel('catalog/product') ->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 ->setCurPage(1); 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.
Friday, April 20, 2012
Retrieve bestsellers
Here is how you can retrieve a list of bestsellers
Subscribe to:
Post Comments (Atom)
Hey there,
ReplyDeleteI 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
Cheers
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.
DeleteMarius.
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..
ReplyDeleteMagento Plugins