Reviews

TODO Einführungstext

Beispiel-Template für Reviews

Das folgende Beispiel zeigt die Ausgabe der Reviews eines Produktes.

{% if product.review_list.review_count > 0 %}
  <h2>Overview</h2>
  <p>This product has {{ product.review_list.review_count }} reviews and a average rating of {{ product.review_list.average_rating }}.</p>
  <ul>
    {% for distribution in product.review_list.distribution %}
      <li> {{ distribution.rating }} stars rating: {{ distribution.count }}</li>
    {% endfor %}
  <ul>

  <h2>All reviews</h2>
  {% for review in product.review_list.reviews %}
    <h3>{{ review.headline }} from {{ review.nickname }}</h3>
    {{ review.body }}
  {% endfor %}
{% else %}
  No reviews available.  
{% endif %}