Hi,
I have added a ratings input and display to my website following this tutorial... https://support.wix.com/en/article/wix-code-tutorial-capturing-and-displaying-ratings
It works fine as as long as there is a value already in the database for the total ratings value and the total number of ratings but if these values are null then there is an error and the database does not get updated.
When we launch the site, I would like to start with 'no ratings' and therefore the field values need to be null. How do I get around this?
Thanks,
Rachel
You should check if the value is null or undefined and then force the display to show no results. You can refer to these two examples:
Ratings Input and Display
Let visitors rate recipes and display the rating results.
Ratings by User
Let logged-in users rate recipes and edit their ratings.