I am looking to fetch top rated products as collections not as an array.
I have followed this tutorial :-
http://odino.org/retrieve-top-rated-products-in-magento/
But it's returning product array i need results as product collections.
I am using mentioned code:-
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->setVisibility(array(2,3,4))
->setPageSize($productCount);
$_productCollection->joinField('rating_summary', 'review/review_aggregate', 'rating_summary', 'entity_pk_value=entity_id', array('entity_type' => 1, 'store_id' => Mage::app()->getStore()->getId()), 'left');
$_productCollection->setOrder('rating_summary', 'desc');
But the problems I am facing with this code is that it gives fatal error:
Call to member function getRatingSummary() on non object & page breaks here.
Any suggestions??