Author Topic: Rating Images not showing up  (Read 33272 times)

remeedella

  • Jr. Member
  • **
  • Posts: 62
Re: Rating Images not showing up
« Reply #45 on: March 17, 2013, 22:01:35 pm »
in all honesty a fresh 2.0.20 or I'm on a fresh 2.0.18 right now it doesn't work out of the box, i just tried a couple of the solutions provided, one of them got them showing i think but wasn't displaying properly in view and was not actually calculating the ratings given, just showing 0 blank stars.

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #46 on: March 18, 2013, 10:35:20 am »
Nice (or not) to see more having problems with this...

raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #47 on: April 03, 2013, 19:35:27 pm »
Solution for VM 2.0.12, Stars not showing up, users can post a review after having posted one:

My Vm administrator version is : 2.0.12 (under extenstion->manage->virtuemart).

The solution to all above is this:

1. Copy file default_reviews.php from <root>/components/com_virtuemart/views/product_details/tmpl  TO <root>/templates/<current_template>/html/com_virtuemart/product_details
2. Find the line
Code: [Select]
<input type="hidden" name="task" value="review"/>3. Add the following line right after it.
Code: [Select]
<input type="hidden" name="created_by" value="<?php echo JFactory::getUser()->id ?>"/>

I had noticed that the reviews in the database table "virtuemart_rating_reviews" didnt have a userid attached to them.

let me know if it helps someone.

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #48 on: April 04, 2013, 10:46:23 am »
Do you know what to do to get the stars show on the product itself and not just numbers (i.e 5/5)?

raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #49 on: April 04, 2013, 13:24:40 pm »
To get stars on the product details page:

1.Copy file default.php from <root>/components/com_virtuemart/views/product_details/tmpl  TO <root>/templates/<current_template>/html/com_virtuemart/product_details
2. Find the following <if> condition :
Code: [Select]
if ($this->showRating) {3. replace the whole block with this:

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

if (empty($this->rating)) { ?>

<span class="vote">
<span title=" <?php echo (JText::_("COM_VIRTUEMART_RATING_TITLE") . $this->rating->rating '/' $maxrating?>" class="vmicon ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth;?>%">
</span>
</span>

<span class="rating-title"><?php echo JText::_('COM_VIRTUEMART_RATING').' '.JText::_('COM_VIRTUEMART_UNRATED'?></span>
</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">
<span title="" class="vmicon ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth;?>%">
</span>
</span>
<span class="rating-title"><?php echo JText::_('COM_VIRTUEMART_RATING').' '.round($this->rating->rating2) . '/'$maxrating?></span>
</span>
<?php } ?>
<?php  ?>

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #50 on: April 04, 2013, 13:36:48 pm »
Thanx. Will try that.

But the file default.php from <root>/components/com_virtuemart/views/product_details lies in another directory called tmpl. Is that correct?
What happens when I copy that to the template? I don't want to change anything else on that page...

raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #51 on: April 04, 2013, 15:01:02 pm »
Thanx. Will try that.

But the file default.php from <root>/components/com_virtuemart/views/product_details lies in another directory called tmpl. Is that correct?
What happens when I copy that to the template? I don't want to change anything else on that page...

Thats correct. i made a mistake. the file is in tmpl folder.
when you copy files to <root>/templates/<current_template>/html they override the original files. this is Joomla's standard practice.

So next time when you update you will not lose these changes.

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #52 on: April 04, 2013, 17:03:32 pm »
Great.

Kind of worked. It messed up my page a bit, and all products got 5 stars even though they're not rated yet...

raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #53 on: April 04, 2013, 19:49:21 pm »
Great.

Kind of worked. It messed up my page a bit, and all products got 5 stars even though they're not rated yet...

you may have made some mistake. or maybe your version is different. if its possible, pm me and i can have a look at your files directly. once it works, we can post the solution here for your version of VM.

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #54 on: April 08, 2013, 11:17:21 am »
What's your version?
Running 2.0.20b. Perhaps it's the template that sensitive to the changes?!

raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #55 on: April 08, 2013, 13:34:50 pm »
What's your version?
Running 2.0.20b. Perhaps it's the template that sensitive to the changes?!

i think it is 2.0.12. its possible that some divs are overlapping. but i am more interested in fixing the rating issue for you. it should be fixed. maybe your version has even more bugs.

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #56 on: April 08, 2013, 14:08:44 pm »
The rating seems to be working with the numbers at least.
Hade a 5 and rated it 1. Now it has 3 (but the product says 3/5). Stars would be so much better...

raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #57 on: April 08, 2013, 23:57:30 pm »
The rating seems to be working with the numbers at least.
Hade a 5 and rated it 1. Now it has 3 (but the product says 3/5). Stars would be so much better...


pm me your site url and the ftp credentials. i will take a look at it and, hopefully, fix it. the fix could help others too.

Favazza

  • Jr. Member
  • **
  • Posts: 54
Re: Rating Images not showing up
« Reply #58 on: April 09, 2013, 14:44:09 pm »
Thanx for taking your time.

Perhaps it's easier to edit the default.php that's already in my template?
Or are there other changes that has to be made and that is why you transfer the file from components/virtuemart?
This is the code I've got now:

Code: [Select]
<?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->rating) . '/'$maxrating;
echo   $rating;
?>


raycarter

  • Beginner
  • *
  • Posts: 39
Re: Rating Images not showing up
« Reply #59 on: April 09, 2013, 15:47:48 pm »
Thanx for taking your time.

Perhaps it's easier to edit the default.php that's already in my template?
Or are there other changes that has to be made and that is why you transfer the file from components/virtuemart?
This is the code I've got now:

Code: [Select]
<?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->rating) . '/'$maxrating;
echo   $rating;
?>



what you sent has no code for images.


replace the whole block with this and let me know what happens.

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

if (empty($this->rating)) { ?>

<span class="vote">
<span title=" <?php echo (JText::_("COM_VIRTUEMART_RATING_TITLE") . $this->rating->rating '/' $maxrating?>" class="vmicon ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth;?>%">
</span>
</span>

<span class="rating-title"><?php echo JText::_('COM_VIRTUEMART_RATING').' '.JText::_('COM_VIRTUEMART_UNRATED'?></span>
</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">
<span title="" class="vmicon ratingbox" style="display:inline-block;">
<span class="stars-orange" style="width:<?php echo $ratingwidth;?>%">
</span>
</span>
<span class="rating-title"><?php echo JText::_('COM_VIRTUEMART_RATING').' '.round($this->rating->rating2) . '/'$maxrating?></span>
</span>
<?php } ?>
<?php  ?>