I have the following code to allow me to show products with a "featured" attribute, on the front page of my store.
$_productCollection=Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('is_featured', 1)
->addAttributeToFilter('status', 1)
->joinField('value','catalog_product_entity_tier_price','value', 'entity_id=entity_id','{{table}}.website_id='.$storeId, 'left')
->setPageSize(9)
->setStoreId($storeId)
->addStoreFilter($storeId);
The issue is, I need to be able to show the product ratings ($this->getReviewsSummaryHtml($_product, 'short') in my normal category listing)
How can I add the data into the collection to allow me to use:
if($_product->getRatingSummary()):
echo $this->getReviewsSummaryHtml($_product, 'short')
endif;
You can use the following in your collection loop:
Mage::helper('review/product')->getReviewsSummaryHtml($_product, false, true);
Your loop should look something like:
foreach($_productCollection as $_product)
{
echo Mage::helper('review/product')->getReviewsSummaryHtml($_product, false, true);
}
This worked for me, in product collection
$reviewHelper = $this->getLayout()->createBlock('review/helper');
echo $reviewHelper->getSummaryHtml($_product, 'short', false);