VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: tobisagt on January 23, 2012, 13:06:12 PM

Title: Review Rating Issue
Post by: tobisagt on January 23, 2012, 13:06:12 PM
------

Pls see this thread for solutions!

http://forum.virtuemart.net/index.php?topic=97611.0

------

Hi there,

the rating system is a little bit confuse...

If i want to write a review i can choose between five stars.
If i did chosse the fifth he shows in the review just a "10" (not stars)
and if i want to display the ratings in my product he shows "5/5" (not stars)

How to show ONLY stars?

Pls see attachment.

And another question, how to display the rating in category view?

-Tobi

[attachment cleanup by admin]
Title: Re: Review Rating Issue
Post by: hollywooood on February 25, 2012, 10:00:31 AM
OK...so here is what I did...

around line 272 on the default.php page in the components>com_virtuemart>views>productdetails>tmpl folder

Replace:
<?php 
                
if($this->showRating){
    $maxrating VmConfig::get('vm_maximum_rating_scale',5);
$rating = empty($this->rating)? JText::_('COM_VIRTUEMART_RATING').' '.JText::_('COM_VIRTUEMART_UNRATED'):JText::_('COM_VIRTUEMART_RATING') . round($this->rating->rating2                    ) . '/'$maxrating;
echo   $rating;
}
?>



With:

<?php 
                
if($this->showRating){
    $maxrating VmConfig::get('vm_maximum_rating_scale',5);
$rating = empty($this->rating)? JText::_('COM_VIRTUEMART_RATING').' '.JText::_('COM_VIRTUEMART_UNRATED'):JText::_('COM_VIRTUEMART_RATING') . round($this->rating->rating2                    ) . '/'$maxrating;
echo "<br/>";
echo   $rating;
if ($rating == "Rating: 0/5"){
echo '<img src="'.JURI::root().'/components/com_virtuemart/assets/images/stars/_0.gif" style="margin-left: 6px;">';
}
if ($rating == "Rating: 1/5"){
echo '<img src="'.JURI::root().'/components/com_virtuemart/assets/images/stars/_1.gif" style="margin-left: 6px;">';
}
if ($rating == "Rating: 2/5"){
echo '<img src="'.JURI::root().'/components/com_virtuemart/assets/images/stars/_2.gif" style="margin-left: 6px;">';
}
if ($rating == "Rating: 3/5"){
echo '<img src="'.JURI::root().'/components/com_virtuemart/assets/images/stars/_3.gif" style="margin-left: 6px;">';
}
if ($rating == "Rating: 4/5"){
echo '<img src="'.JURI::root().'/components/com_virtuemart/assets/images/stars/_4.gif" style="margin-left: 6px;">';
}
if ($rating == "Rating: 5/5"){
echo '<img src="'.JURI::root().'/components/com_virtuemart/assets/images/stars/_5.gif" style="margin-left: 6px;">';
}

}
?>



Make sure you have your star images in the proper folder and you should be good to go. 

Title: Re: Review Rating Issue
Post by: fxer on February 27, 2012, 02:16:39 AM
hi,

Thank you hollywooood but didn't work with joomla 1.5.25 !

dose it work for you ?

I have deleted the extra } ,buy still didn't work.
Title: Re: Review Rating Issue
Post by: tobisagt on February 27, 2012, 14:14:55 PM
There is already another thread which is more helpful.

http://forum.virtuemart.net/index.php?topic=97611.0

I think this thread can be closed!