Notifications
Clear all

Is it possible to do this?

4 Posts
2 Users
0 Likes
2,337 Views
(@fabryz)
New Member
Joined: 6 years ago
Posts: 3
Topic starter  

Hello,

I have just downloaded the WP plugin and I’m fiddling with it. I’m making a single page where the unregistered user can select his favourite product (a custom post type) and then rate + comment it.

At the moment I’m developing the needed steps via AJAX calls that send/retrieve the needed data. I saw it is possible to add the rating field on the form, so I added it and toggled some of the configurations.

I’d need help to understand what I will be able to do, also in order to make time extimations for my client.

 Questions about what can be done, it would be appreciated if you could also suggest how to make it happen:

  1. Is it possible to inject the comment form via AJAX? Given the post_id. I tried to inject it programmatically in a custom page template I made but it doesn't work
  2. Is it possible to retrieve the comments and ratings for a certain post_id, via AJAX?
  3. Is it possible to retrieve all the comments and rating? We will need to generate a REST API that exposes the collected data in JSON format
  4. Is it possible to make the comment required only for ratings with a certain value below or equal X?
  5. Is it possible to change the logic that makes the user vote multiple times?
  6. Is it possible to understand if a user has already voted/commented with a certain email address?

 

Looking forward for your help

Thanks


   
Quote
(@fabryz)
New Member
Joined: 6 years ago
Posts: 3
Topic starter  

It removed all the numbers on the questions, please answer with it 🙂


   
ReplyQuote
 Tom
(@tomson)
Famed Member Admin
Joined: 9 years ago
Posts: 4171
 

Hi @fabryz,

Please find my answers below:

Is it possible to inject the comment form via AJAX? Given the post_id. I tried to inject it programmatically in a custom page template I made but it doesn't work.

I'm sorry but not. There is not a one single reason so I can't provide all details for this.

Is it possible to retrieve the comments and ratings for a certain post_id, via AJAX?

Is it possible to retrieve all the comments and rating? We will need to generate a REST API that exposes the collected data in JSON format

All data are saved in _comments, _commentmeta, _wc_users_voted table. You can use whether WordPress functions or create own functions. wpDiscuz doesn't have API for developers yet. We're working on it.

Is it possible to make the comment required only for ratings with a certain value below or equal X?

wpDiscuz doesn't have such option and function.

Is it possible to change the logic that makes the user vote multiple times?

wpDiscuz logs voters in _wc_users_voted table. The only way to allow the same user to vote for the same comment is removing voting log from the table.

Is it possible to understand if a user has already voted/commented with a certain email address?

I think this can only work for Users not for Guests. Using email you can get UserID and get all votes from _wc_users_voted table.


   
ReplyQuote
(@fabryz)
New Member
Joined: 6 years ago
Posts: 3
Topic starter  
Posted by: Tom

Hi @fabryz,

Please find my answers below:

Is it possible to inject the comment form via AJAX? Given the post_id. I tried to inject it programmatically in a custom page template I made but it doesn't work.

I'm sorry but not. There is not a one single reason so I can't provide all details for this.

Is it possible to retrieve the comments and ratings for a certain post_id, via AJAX?

Is it possible to retrieve all the comments and rating? We will need to generate a REST API that exposes the collected data in JSON format

All data are saved in _comments, _commentmeta, _wc_users_voted table. You can use whether WordPress functions or create own functions. wpDiscuz doesn't have API for developers yet. We're working on it.

Is it possible to make the comment required only for ratings with a certain value below or equal X?

wpDiscuz doesn't have such option and function.

Is it possible to change the logic that makes the user vote multiple times?

wpDiscuz logs voters in _wc_users_voted table. The only way to allow the same user to vote for the same comment is removing voting log from the table.

Is it possible to understand if a user has already voted/commented with a certain email address?

I think this can only work for Users not for Guests. Using email you can get UserID and get all votes from _wc_users_voted table.

Thanks @Tomson


   
ReplyQuote
Share:
Scroll to top