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:
- 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
- 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
- Is it possible to make the comment required only for ratings with a certain value below or equal X?
- Is it possible to change the logic that makes the user vote multiple times?
- Is it possible to understand if a user has already voted/commented with a certain email address?
Looking forward for your help
Thanks
It removed all the numbers on the questions, please answer with it 🙂
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.
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