1. This is currently only possible by adding your own custom fields as shown here: https://pastebin.com/4fvKErcp
2. This can be done by hiding the main rating field on the form, and then using the “site-reviews/create/review-values” hook where you would manually set the rating value based on the calculated average rating of the combined custom rating fields. Something like this:
/**
* Manually set the primary rating of the review when it is created.
* The rating will be the rounded average of the custom rating fields.
*
* @param array $values
* @return array
*/
add_filter('site-reviews/create/review-values', function ($values) {
$ratings = [
intval(glsr_get($values, 'custom.storyline_rating', 0)),
intval(glsr_get($values, 'custom.graphics_rating', 0)),
intval(glsr_get($values, 'custom.music_rating', 0)),
intval(glsr_get($values, 'custom.presentation_rating', 0)),
];
$ratingsSum = array_sum($ratings);
$ratingsCount = count($ratings);
$values['rating'] = round($ratingsSum / $ratingsCount);
return $values;
});
3. Not without custom PHP code (see no.1)
4. Please see: https://github.com/pryley/site-reviews/blob/master/ROADMAP.md
+1 for all these features (1-2).
Not totally clear what @scratchmaster meant about custom fields (#3´), but if
he meant custom field value as a rating criteria, my thumbs up, I agree.
(I add custom taxonomy also as a rating criteria though)
Even in a payed, Pro version, from my side.
-
This reply was modified 6 years, 4 months ago by
Vane.
@vanetreg
He means being able to customise the review form (i.e. adding custom fields) without having to write any PHP. Currently the only way to add your own custom fields is add them with PHP as explained here: https://pastebin.com/4fvKErcp
The “Review Form Builder” add-on shown in the plugin roadmap will allow you to customise the review submission form from within the WordPress admin without having to write any PHP code.
This add-on has not yet been developed, but it should be available sometime in the first half of this year.
I am unsure of what you mean by, “custom taxonomy also as a rating criteria”.
-
This reply was modified 6 years, 4 months ago by
Gemini Labs.
@geminilabs
Sorry, I don’t want to OFF this thread.
“custom taxonomy also as a rating criteria”
I meant re #1 (called multi-criteria rating elsewhere) we might use custom field or custom taxonomy values as rating criterias,
like in original post:
Storyline, Graphics, Music, Presentation, etc.
added as shortcode, for example. Like:
Rating Criteria 1 = [wpcf-storyline]
Rating Criteria 2 = [wpcf-graphics]
etc.
You mean only show the custom fields on specific forms?
i.e.
Page 1: show the default rating form.
Page 2: show the rating form with 3 additional custom rating fields.
Page 3: show the rating form with 1 additional custom rating field.
This is also possible. The easiest way would be to conditionally add your custom form fields (with the site-reviews/config/forms/submission-form hook as demonstrated in https://pastebin.com/4fvKErcp) by using the global $post object (i.e. get_post()) to verify which page the form is being loaded on. For example, you could use the Custom Fields meta box on your page to add a custom value, then check for this meta_value in the hook and add the custom fields appropriately.
Please keep in mind however, adding custom fields is not actively supported here. If you want to add custom fields to your review form, you will need to figure it out on your own using the https://pastebin.com/4fvKErcp examples to guide you.
-
This reply was modified 6 years, 4 months ago by
Gemini Labs.