News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Rating inside Virtuemart 3 Products Module

Started by etna, April 28, 2015, 09:14:37 AM

Previous topic - Next topic

etna

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

jenkinhill

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/
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

etna

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

webpiksel

<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>
Tanie strony internetowe dla firm z Płocka, Włocławka, Mławy i Płońska http://www.webpiksel.pl