*

Tango

  • ****
  • 214 posts
Comment - Rating
« on: December 19, 2021, 09:40:17 PM »
Since Osclass 4.2.0, users have the option to leave ratings on comments, which means that the comment can now be simply transformed into item review.
The problem with this feature in it's current form, is that it's half-baked, meaning that the ratings really have no actual purpose, besides the visual one in the comments section.

To fix this, we also need an option to calculate the total rating based on the number of ratings received, and display it somewhere with a shortcode.
Why shortcode/function? Because this would allow us to display the ratings in different spots.

Basically, we need another 2 functions here:
  • A function that counts and outputs the number of ratings: eg. (10 ratings)
  • A functions that calculates and outputs the total rating, based on the above function.

It should be something like this:




PS: What would make this truly a review system, would be the ability to select in which category the ratings are allowed like in the Voting Plugin, and also hook this to the search page (sort by rating) like you did on https://osclasspoint.com/search
However I think this would be too much to ask.

Thanks!
« Last Edit: December 19, 2021, 09:49:40 PM by Tango »

*

MB Themes

Re: Comment - Rating
« Reply #1 on: December 21, 2021, 08:26:16 AM »
@Tango
Thanks for feedback, when time permits, we will add helper functions into core.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on January 04, 2022, 01:14:37 PM
*

MB Themes

Re: Comment - Rating
« Reply #2 on: January 04, 2022, 11:36:05 AM »
@Tango
Reviewed core and there already is function for that:
Code: [Select]
osc_count_item_comments();
osc_count_item_comments_rating();

Integration in theme is purely on theme author/developer.
Sigma theme also use custom integration for comments.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots