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

Rating Stars doesn't load

Started by jorgepracticum, November 25, 2015, 11:39:27 AM

Previous topic - Next topic

jorgepracticum

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

jenkinhill

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.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

jorgepracticum

Ok
Thanks
I'll ask the template developer
Regards

jorgepracticum

#3
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  :'(

jenkinhill

Autopublish works fine for me, Joomla 3.4.5, VirtueMart3.0.12 with default VirtueMart template. Maybe a template problem?
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

jorgepracticum

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

GJC Web Design

check in the database to see if the rating is stored
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

And switch the template to Protostar to see it it works there.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jorgepracticum

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

GJC Web Design

Quotecheck in the database to see if the rating is stored

so is it actually in the DB table after saving?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jorgepracticum

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