vendor/shopware/storefront/Resources/views/storefront/component/review/rating.html.twig line 1

Open in your IDE?
  1. {% block component_review_rating %}
  2.     {% set full = points|round(0, 'floor')   %}
  3.     {% set left = points - full  %}
  4.     {% if left >= 0.25 and left<0.75 %}
  5.         {% set half = 1 %}
  6.     {% endif %}
  7.     {% if left >=0.75 %}
  8.         {% set full = full + 1 %}
  9.     {% endif %}
  10.     {% set blank = 5 - full - half  %}
  11.     {% block component_review_rating_output %}
  12.         <span class="product-review-rating">
  13.             {% if full > 0 %}
  14.                 {% for star in range(1,full) %}
  15.                     {% sw_include '@Storefront/storefront/component/review/point.html.twig' with {
  16.                         type: 'full'
  17.                     } %}
  18.                 {% endfor %}
  19.             {% endif %}
  20.             {% if half %}
  21.                 {% sw_include '@Storefront/storefront/component/review/point.html.twig' with {
  22.                     type: 'half'
  23.                 } %}
  24.             {% endif %}
  25.             {% if blank > 0 %}
  26.                 {% for star in range(1,blank) %}
  27.                     {% sw_include '@Storefront/storefront/component/review/point.html.twig' with {
  28.                         type: 'blank'
  29.                     } %}
  30.                 {% endfor %}
  31.             {% endif %}
  32.         </span>
  33.     {% endblock %}
  34. {% endblock %}