Hi to all!
The star rating system seems to doesn't work properly: if you go to the tab and try to rate the products, too many stars appears, but if you refresh the page everything seems to be ok. Than you rate, i.e. 4 star, and the system gave 5 star to the product...
can anyone supports me for this issue?
[attachment cleanup by admin]
http://forum.virtuemart.net/index.php?topic=79799.0
I'm sorry,
Vm 2.0.18a - Joomla 2.5.8 stable
I resolved my issue by it being a jquery conflict. I see that you have tabs like me. If your tabs are using some jquery code I suggest you look there.
A thing to note though is to disable the tabs and see if the stars work. You can do this by taking out the code that controls the tabs or if you are using override files then you can default back to the default.php file and see. If it works then with tab code disable then you know that is conflicting it.
Let me know if that works or you need more help. I put the jquery tab code in the same file as my default.php override file and it works. Not sure if I am going to keep it there or some how get it to work in an external js file.
open the file:
/components/com_virtuemart/views/productdetails/tmpl/default_reviews.php
...better to copy here:
/templates/yourtemplate/html/com_virtuemart/productdetails/default_reviews.php
there is javascript function:
jQuery(function($) {
var steps = " . $maxrating . ";
var parentPos= $('.write-reviews .ratingbox').position();
var boxWidth = $('.write-reviews .ratingbox').width();// nbr of total pixels
var starSize = (boxWidth/steps);
var ratingboxPos= $('.write-reviews .ratingbox').offset();
$('.write-reviews .ratingbox').mousemove( function(e){
var span = $(this).children();
var dif = e.pageX-ratingboxPos.left; // nbr of pixels
difRatio = Math.floor(dif/boxWidth* steps )+1; //step
span.width(difRatio*starSize);
$('#vote').val(difRatio);
//console.log('note = ', difRatio);
});
});
change it like that:
jQuery(function($) {
var steps = " . $maxrating . ";
var parentPos= $('.write-reviews .ratingbox').position();
var boxWidth = $('.write-reviews .ratingbox').width();// nbr of total pixels
var starSize = (boxWidth/steps);
$('.write-reviews .ratingbox').mousemove( function(e){
var ratingboxPos= $('.write-reviews .ratingbox').offset();
var span = $(this).children();
var dif = e.pageX-ratingboxPos.left; // nbr of pixels
difRatio = Math.floor(dif/boxWidth* steps )+1; //step
span.width(difRatio*starSize);
$('#vote').val(difRatio);
//console.log('note = ', difRatio);
});
});
I have apply this fix and now my stars show correclty but ... i CANT choose stars ... it always write 5 stars ...
VM 3.0.10 Joomla 3.4.5
You could check here on my test site ver3.dr-ink.ca
Good monday, ;)
Open: default_reviews.php file
jQuery(function($) {
var steps = ".$maxrating.";
var parentPos= $('.rating .ratingbox').position();
var boxWidth = $('.rating .ratingbox').width();// nbr of total pixels
var starSize = (boxWidth/steps);
var ratingboxPos= $('.rating .ratingbox').offset();
jQuery('.rating .ratingbox').mousemove( function(e){
var span = jQuery(this).children();
var dif = e.pageX-ratingboxPos.left; // nbr of pixels
difRatio = Math.floor(dif/boxWidth* steps )+1; //step
span.width(difRatio*starSize);
$('#vote').val(difRatio);
//console.log('note = ',parentPos, boxWidth, ratingboxPos);
});
});
Replace:
jQuery(function($) {
var steps = ".$maxrating.";
var parentPos= $('.rating .ratingbox').position();
var boxWidth = $('.rating .ratingbox').width();// nbr of total pixels
var starSize = (boxWidth/steps);
jQuery('.rating .ratingbox').mousemove( function(e){
var ratingboxPos= $('.rating .ratingbox').offset();
var span = jQuery(this).children();
var dif = e.pageX-ratingboxPos.left; // nbr of pixels
difRatio = Math.floor(dif/boxWidth* steps )+1; //step
span.width(difRatio*starSize);
$('#vote').val(difRatio);
//console.log('note = ',parentPos, boxWidth, ratingboxPos);
});
});
nice hit.
It should be implemented to the core code