Hi guys, hope I'm not too late!
To pull back individual product ratings for each product in category view you need to edit com_virtuemart/views/category/view.html.php
Around line 142 you need to change...
foreach($products as $product)
{
$product->stock = $productModel->getStockIndicator($product);
}
to...
$ratingModel = VmModel::getModel('ratings');
foreach($products as $product)
{
$product->stock = $productModel->getStockIndicator($product);
$product->showRating = $ratingModel->showRating($product->virtuemart_product_id);
if ($product->showRating)
{
$product->vote = $ratingModel->getVoteByProduct($product->virtuemart_product_id);
$product->rating = $ratingModel->getRatingByProduct($product->virtuemart_product_id);
}
}
THEN you add the following where you want to show the stars for each product (com_virtuemart/views/category/tmpl/default.php)...
<?php if($product->showRating): ?>
<?php $maxrating = VmConfig::get('vm_maximum_rating_scale', 5); ?>
<?php if (!empty($product->rating)):
$ratingwidth = ( $product->rating->rating * 100 ) / $maxrating; ?>
<span class="vote">
<?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' . round($product->rating->rating, 2) . '/' . $maxrating; ?><br/>
<span title=" <?php echo (JText::_("COM_VIRTUEMART_RATING_TITLE") . $product->rating->rating . '/' . $maxrating) ?>" class="vmicon ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth.'%'; ?>"></span>
</span>
</span>
<br/><br/>
<?php endif ?>
<?php endif ?>
bingo bango bongo