VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: salim on June 26, 2013, 08:31:25 AM

Title: how to show how much people have voted to the product
Post by: salim on June 26, 2013, 08:31:25 AM
Hi
I want to show How much people have voted to the product (total votes of product),
How can I do this?
Title: Re: how to show how much people have voted to the product
Post by: semaphorev on July 01, 2013, 10:57:53 AM
for that you need to install extensions like Reviews for Virtuemart
Title: Re: how to show how much people have voted to the product
Post by: PRO on July 01, 2013, 11:12:55 AM
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
          }
      }?>