New in the Wix Editor! Ratings Input and Display Elements
Now you can collect ratings and display them with stunning preset designs on your site.
Use Ratings Input to let customers rate your products and services - then use Ratings Display to show them off on your site.
We give these Ratings 5 stars! Now it’s your turn.
To add Ratings Input:
Open the Editor > go to the Add Panel > click User Input > click Ratings > add Ratings
Input
To add Ratings Display:
Open the Editor > go to the Add Panel > click User Input > click Ratings > add Ratings Display
- Learn how to Collect Ratings or Display Ratings
- Find out how to collect ratings for products and services on your site. Get Ratings
- To add code to Ratings elements, go to Ratings Input and Ratings Display in the API reference.
So I think I figured out how to make the substitutions....please see below....but it still doesn't work. What am I doing wrong?
export function ratingsInput1_change(event) { $w("#dynamicDataset").onReady(() => { // get the current item from the dataset const currentItem = $w("#dynamicDataset").getCurrentItem(); // get the current average rating, number of ratings, and //total ratings for the current dataset item const average = currentItem.avgeRating; const count = currentItem.noOfRatings; const total = currentItem.rSum; // get the new rating from the ratings input const newRating = $w('#ratingsInput1').value; // calculate the new average rating based on the current //average and count const newAverageLong = (total + newRating) / (count +1); // Round the average rating to 1 decimal point const newAverageShort = Number.parseFloat(newAverageLong).toFixed(1); // set the dataset fields to the new average, total // ratings, and number of ratings $w('#dynamicDataset').setFieldValues({ 'avgeRating': newAverageShort, 'rSum': total + newRating, 'noOfRatings': (count + 1) }); // save the dataset fields to the collection $w('#dynamicDataset').save() .catch((err) => { console.log('could not save new rating'); }); }); }
Hi Idan, I've tried adding the ratings input and rating display on this dynamic page, but it doesn't seem to be working. When I click the stars, they change color....so far, so good...but then when I refresh the page, the ratings display remains empty. Would be grateful for your guidance. Thanks, Josh
https://www.grahameschocolateguide.com/Chocolatiers/Alain-Ducasse
It finally works again for me, thanks!
How come Wix no longer allows rating displays to be attached to repeater elements? I know they did in the past (as I had one attached to my repeater element), but when I contacted Wix to ask why I could no longer attach it, they said doing so is not possible. i requested that Wix once again allow this feature, do you know when this will happen?
I used the previous version that needed to put a dropdown menu to record the evaluation, sometimes it worked other times not. Now using the two at the same time I can do exactly what I want. Thank you!
Yes!!!!