Problems on the rating system of Wix Booking site

Hello, everybody.
I have made rating system on existing wix booking site.
The site works well when I login with my admin account.
But when I visit the site and make a new account and login, then it troubles.
It shows the review and ratings of the service, but doesn’t show the reviewer’s name and image.
This is our site: tlxproservice.com
This is the databbase structure of our site:


Reviewer field in service_reviews collection is reference field connected to privatemembers collection marked above.
As you can see below, the Review repeater is linked with service_reviews data collection.
Reviewer’s name is linked with the reference field and the review is linked with Review(text) field.


The problem when I login with new account is as follows:

  1. The review’s data doesn’t appear on repeater
  2. I can’t make a review
    Now no 1 is quite clear for you, I think. Let me explain more about no 2.
    I got the current user’s data with following code:

import wixData from ‘wix-data’;
import wixUsers from ‘wix-users’;

$w(‘#GetReviewDataset’).onBeforeSave(() => {
let user = wixUsers.currentUser;
let current_service = $w(‘#BookingItemdynamicDataset’).getCurrentItem();
$w(‘#GetReviewDataset’).setFieldValue(‘service’, current_service._id);
$w(‘#GetReviewDataset’).setFieldValue(‘reviewer’, user.id);
})
$w(‘#GetReviewDataset’).onAfterSave(() => {
let current_service = $w(‘#ServiceInfo’).getCurrentItem();
let review_count, total_rating, new_rating;
review_count = current_service.reviewCount;
total_rating = current_service.totalRating;
new_rating = $w(‘#RatingInput’).value;
// update the review count and total rating
$w(‘#ServiceInfo’).setFieldValues({
‘reviewCount’: (review_count + 1),
‘totalRating’: (total_rating + new_rating)
})
$w(‘#ServiceInfo’).save()
.then((result) => {
console.log(‘updating…’)
$w(‘#ServiceInfo’).refresh();
calculateRating();
console.log(‘…updated’)
})
.catch((err) => {
console.log(‘error saving’);
});
$w(‘#ServiceReviewsDataset’).refresh();
});
$w(‘#ServiceInfo’).onReady(() => {
calculateRating();
});
});

I would like to listen to your opinion why there problems happen.
If you can’t understand what I mean, I will provide you more information.
Thank you in advance.

Hi!

I’d suggest to check couple of things:

  • Permissions. Sometimes the permissions are set to only show content to the admin;
  • If your dataset use fiters, check, if they are not broken.
  • Check if connections between dataset and repeater are not broken as well.
    This may happen when you rename / delete fields in your database.

Thank you for your reply.
Let me explain more detail.
Overall I would like to make the rating system in which only the customers who has ever used this service can make a review and rating.
So I linked the Private members collection to the service_review data collection.
Would you kindly comment on me regarding this problem?
1.Which collection is customer collection in Wix booking site?
2.If the private members collection is customer collection, how can I connect that collection to the reviews collection?
I want your idea on how to implement this user rating to current rating system.
Thank you in advance.