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

Review Rating Issue

Started by tobisagt, January 23, 2012, 13:06:12 PM

Previous topic - Next topic

tobisagt

------

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]

hollywooood

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. 

Joomla 2.5.4
Virtuemart 2.0.6
PHP 5.2.17
MySQL 5.5.21-55
APACHE 2.2.22

fxer

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.

tobisagt

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!