Hi
I was using this to show the rating stars in Featured Products Module in VM 2 but it looks that is not working in VM 3, any help?
Quote
<?php
if (!empty($product->rating)):
$ratingwidth = ( $product->rating->rating * 100 ) / $maxrating; ?>
<span class="rating">
<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>
<?php else:?>
<span>not rated yet </span>
<?php endif ?>
Thanks
Joomla 3.4.1
VM 3.0.8
PHP 5.3.29
Ratings in VM modules show by default in VM3.0.8 when using VM default templates. eg see latest/featured on http://demo.virtuemart.net/
Thank you for the answer but these products, that have rating here http://demo.virtuemart.net/ (Featured - Latest - Top Ten) are part of the VM frontpage and are controlled by the ../com_virtuemart/sublayouts/products.php.
My question is about "Products module" that is inside ../modules/mod_virtuemart_product/tmpl/default.php, that does not contain code for the rating.
So the question remain.
Regards
<div class="vm-product-rating-container">
<?php
$ratingwidth = $product->rating * 24; ?>
<div title=" <?php echo (vmText::_("COM_VIRTUEMART_RATING_TITLE") . round($product->rating) . '/' . $maxrating) ?>" class="ratingbox" >
<div class="stars-orange" style="width:<?php echo $ratingwidth.'px'; ?>"></div>
</div>