Hi All, I want to create counter variable inside for loop that has paginate,
I’ve use app to create metafields, and check that metafield value in loop
How to get the total of each variable value ? Can anyone give me hint how the right way to do this ?
Here’s my code
{% assign blog = blogs.review %}
{% paginate blog.articles by 3%}
{% if blog.articles_count > 0 %}
{% for article in blog.articles %}
{% case article.metafields.post_attribute.post_rating %}
{% when '5' %}
{% assign star5 = star5 | plus: 1 %}
{% when '4' %}
{% assign star4 = star4 | plus: 1 %}
{% when '3' %}
{% assign star3 = star3 | plus: 1 %}
{% when '2' %}
{% assign star2 = star2 | plus: 1 %}
{% else %}
{% assign star1 = star1 | plus: 1 %}
{% endcase %}
{% endfor %}
{% endif %}
{% endpaginate %}