Adding Rating system to Comments App
Has anyone here added a star rating to the Comments App? I am trying to do this and would love it if someone has already done this and can help me find the SQL insert query, or do it for me, as a paying job of course.
You should be able to add a rating field to the comments form.
Drew, Yes, I did that, that's the easy part. Perhaps I'm not clear on this, but don't I have to alter the sql insert statement to make sure the additional fields are added to the table? And, don't I have to create a field in the comments_app table to store the rating? That's where I need the help.
And, while I have your attention, do I need to install the forms_app in order to process the comments_app form? Or does that come with the comments app? I can't find mention of that in the docs.
Thank you.
No, you don't need to do that - just add the field to both the comment form and the comment display.
Wonderful, thank you. I had found the line of code to display comments on a page, but now I can't find it. Can you point me in the right direction? Even a search of your docs don't show me what I'm looking for.
https://docs.grabaperch.com/functions/comments/perch-comments/
Drew,
I'm sorry, I'm pretty dense. But, I'm using this as a separate page not linked to a product or blog. Simply a page where you can leave a comment on the service you received. More like a review. So, There won't be any identifier. Is there a way to display all the submitted comments at once? Without the need to pass an ID?
Just make up an identifier - something like "general" would do. Just give it something.
Thank you, again.
I am submitting the form and it's not being inserted into the database table. I turned on debug and when the initial form page loads this is the output on that page
Also upon a successful submission I get the following in debug:
Any help would be greatly appreciated. I am lost from here.
What does your template look like? And, please post your Diagnostics Report too - thanks!
When you say template, do you mean the page template or the content templates? The content template is your standard form just altered to add a star rating:
My Diagnostics Report:
Hosting settings
~~~
Ok so the first thing to do would be to update Perch, you are a few versions back and any advice we give will be based ont he latest version.
It's generally a good idea to update before doing any additional development work on a project as we fix and improve things with each release.
Once you've updated let us know if the issue still exists.
I saw that I'm outdated and I'm updating now. Will report back shortly. Thank you.
I copied the core folder into the site and, unfortunately, the same response. The review is not being inserted into the db.
What problem are you seeing?
I fill in the form on the page and hit submit and the submission is not inserted into the database. On the page, the success message is displayed, but again, it hasn't been inserted into the database. In the admin, there are no comments pending, or approved. No comments at all.
Is the above the whole of the debug output when submitting a comment?
Yes I copied everything that was output with the debug.
There should be a lot more than that, so perhaps something is throwing an error.
Is there anything in the server error log?
here is the full report from a submission. If this isn't everything, then I don't know what you need. To be honest with you, I'm using Mamp PRO on a mac. I don't know how to find server logs. That's a bit over my head.