In the main product-list template, you will see the collection populated with $_productCollection=$this->getLoadedProductCollection();
somewhere near the top of file. Depending on whether you are using a custom theme, the file's location may be different, but the filepath will be something like this:
[magento-root]/app/design/frontend/<your-theme>/<your-subtheme>/template/catalog/product/list.phtml
Note: This is extending the default template, located at
[magento-root]/app/design/frontend/base/default/template/catalog/product/list.phtml
There are a few things that you could experiment with, but basically, you'd loop through the product-collection and use $_product->getRatingSummary()
and possibly $_product->getReviewSummaryHtml()
to get what some in-depth information.
Luckily, the default template already looks for a review, so you really just need to add a counter and/or custom logic in the two places that you see <?php if($_product->getRatingSummary()): ?>
So, if all you are looking for is the count. Add the following to the top of your file:
$reviewCount = 0;
..and there are two places (list and grid mode) that you would find a place to increment it. In the simplest example, you would replace this:
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product) ?>
<?php endif; ?>
with this:
<?php if($_product->getRatingSummary()) {
$reviewCount++;
echo $this->getReviewsSummaryHtml($_product) ?>
}?>
And after the loop is finished, you would have the total number of reviews for the category. If you need it at the top of the product-list, you could loop through on your own and add custom output:
<?php
$reviews = array(); // this will be populated with the output for products with reviews
foreach ($_productCollection as $_product) {
if($_product->getRatingSummary())
$reviews[] = $this->getReviewsSummaryHtml($_product, 'short');
}
$reviewCount = count($reviews);
?>