Product Reviews – how to get the overall rating
-
Greetings Blocksy people!
I would like to display the average rating of my current product review in Elementor by using their Star Rating Widget with the Dynamic Tags functionality.
The problem is that, I can’t find any field that contains this data in a format like “4.6”.
As a workaround I ended up creating a shortcode that writes out the HTML of the rating with the “blocksy_get_product_review_overall_score” function like this:
add_shortcode('blocksy_overall_score', function () { $id = get_the_ID(); $output = ''; if (function_exists('blocksy_get_product_review_overall_score') && $id) { $output = blocksy_get_product_review_overall_score($id); } echo $output; });
In a similar way, I could also create a shortcode that returns the rating in number format.
Do you have a better idea? Perhaps could you introduce additional shortcodes to return the overall scores, as well?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Product Reviews – how to get the overall rating’ is closed to new replies.