You can show the star rating of a product in your abandonment emails or recommendations. This can either be as a number or a capture of any image.
Before you start
Things you need to know:
You’ll need to contact Support to request this feature be enabled.
You can use HTML symbols, for example, https://www.toptal.com/designers/htmlarrows/symbols/black-star/, instead of images and then use CSS to style them.
Jinja code
If we can only capture the numeric value, it's still possible to create a star rating by using the Jinja code outlined below:
{# this assumes the rating is stored in product.ex.rating but you may need to check that is the case #}
{% for x in range(product.ex.rating|round|int) %}
<img src="http://path/to/your.image/1star.jpg">
{% endfor %}
{% for x in range((5) - (product.ex.rating|round|int)) %}
<img src="http://path/to/your.image/emptystar.jpg">
{% endfor %}
The first For statement loops over the value and adds the amount of stars based on the rating, for example, product rating 3.5/5 = add 3 stars.
The second For statement loops over the value and adds the remaining amount, for example, product rating 3.5/5 = add 2 empty stars.
You can add any styling you require to the images or around the block.
This code rounds the value to the nearest integer; 3.5 rounds to 3.
This code assumes you have two images; one for a full star and one for an empty star.