Hi
I'm using VM 3 and Joomla 3.4.5
I can rate and comment about a product of my shop and I can see those information in the product details tab but in the frontpage of VM I see the stars like nobody votes about the product... I think the problem is in the file: components/com_virtuemart/sublayouts/rating.php
Well, I'm using the shoplab template to show VM, and the same file is in templates/shoplab/html/com_virtuemart/sublayouts/rating.php
In this file, it checks if the product has rating
<?php defined('_JEXEC') or die('Restricted access');
$product = $viewData['product'];
if ($viewData['showRating']) {
$maxrating = VmConfig::get('vm_maximum_rating_scale', 5);
if (empty($product->rating)) {
?>
<div class="ratingbox dummy" title="<?php echo vmText::_('COM_VIRTUEMART_UNRATED'); ?>" >
</div>
<?php
} else {
$ratingwidth = $product->rating * 24;
?>
<div title=" <?php echo (vmText::_("COM_VIRTUEMART_RATING_TITLE") . round($product->rating) . '/' . $maxrating) ?>" class="ratingbox">
<div class="stars-orange" style="width:<?php echo $ratingwidth.'px'; ?>"></div>
</div><div class="clear"></div>
<?php
}
}
In the if condition:
if (empty($product->rating))
This line return false when I have one comment and rating about a product. In fact, "$product->rating" is null
In my VM configuration I enable the necesary functions to show and make coments and ratings
What is wrong?
Regards
I am using VM3.0.12 on J3.4.5 with VM default templates. I have no problem with the stars showing so you may have to ask the template developer.
Image below is before and then after posting one review giving 4 stars.
Ok
Thanks
I'll ask the template developer
Regards
Hi again
I asked the template developers and they didn't resolve my problem. They only said me that they will fix this in their next release
But I need to solve this now
So I have tried to change the template to check if the error is from template. I have seen that in any template the stars load... So I think that is VirtueMart problem.
How can I trace the execution to try to see what is happening?
Regards
EDITED:
Hi
I was looking the database and I realised that there was a parameter that made me feel strange... The table is #_virtuemart_rating_reviews and the parameter is "review_ok"
I went to VirtueMart's backend and saw all the reviews and votes and I noticed that the review wasn't published. I published it and voilĂ , the stars changed!!
So my question is: Why the review appears on the reviews tab but the stars don't change when the review isn't published?
Regards
EDITED 2:
Hi
I have looked for an option to autopublish the reviews and I found it. The problem is that the option is checked, so it should autopublish the reviews, but it doesn't work
Do you know why this is happening?
Regards and sorry for all message :'(
Autopublish works fine for me, Joomla 3.4.5, VirtueMart3.0.12 with default VirtueMart template. Maybe a template problem?
You mean that the problem is that the template doesn't work good when someone write a review?
I mean, someone write a review and select a number of stars, then he or she click on "Submit comment" and then the template doesn't storage the data properly in the database
Do you mean that?
Regards
check in the database to see if the rating is stored
And switch the template to Protostar to see it it works there.
and make sure your VM is up to date..which is why we have updates.. bug fixes and security.. + added features 3.0.12 is current
Hi
The template saves the all rating information properly
And with protostar the problem still persist
I have that version of VM
So I think that the problem is when the component saves the information in the database
Quotecheck in the database to see if the rating is stored
so is it actually in the DB table after saving?
Hi
I'm really sorry about not answer your question. I was too busy to read the forum. I'm sorry
Well, the rating stores in the database it stores properly but the parameter "review_ok" is checked as false (with a 0)
So I think that the problem is that the component doesn't store the information properly in my Joomla
Regards