News:

Looking for documentation? Take a look on our wiki

Main Menu

how to show how much people have voted to the product

Started by salim, June 26, 2013, 08:31:25 AM

Previous topic - Next topic

salim

Hi
I want to show How much people have voted to the product (total votes of product),
How can I do this?

semaphorev

for that you need to install extensions like Reviews for Virtuemart

PRO

salim,

have you enabled the review & rating system for everybody?

<?php
      if ($this->showRating) {
          $maxrating = VmConfig::get('vm_maximum_rating_scale', 5);

          if (empty($this->rating)) {
         ?>
         <span class="vote"><?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' . JText::_('COM_VIRTUEMART_UNRATED') ?></span>
             <?php
         } else {
             $ratingwidth = ( $this->rating->rating * 100 ) / $maxrating; //I don't use round as percetntage with works perfect, as for me
             ?>
         <span class="vote width100">
   <?php echo JText::_('COM_VIRTUEMART_RATING') . ' ' . round($this->rating->rating, 2) . '/' . $maxrating; ?>
             <span title=" <?php echo (JText::_("COM_VIRTUEMART_RATING_TITLE") . $this->rating->rating . '/' . $maxrating) ?>" class="ratingbox" style="display:inline-block;">
            <span class="stars-orange" style="width:<?php echo $ratingwidth.'%'; ?>">
            </span>
             </span>
         </span>
         <?php
          }
      }?>