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)|round %}
  4.     {% set left = left / 4 %}
  5.     {% if left > 0 %}
  6.         {% set half = 1 %}
  7.     {% endif %}
  8.     {% set blank = 5 - full - half  %}
  9.     {% block component_review_rating_output %}
  10.         {# @deprecated tag:v6.5.0 - span will be a div because a span should not contain divs #}
  11.         {% if feature('v6.5.0.0') %}
  12.             <div class="product-review-rating">
  13.         {% else %}
  14.             <span class="product-review-rating">
  15.         {% endif %}
  16.             {% if full > 0 %}
  17.                 {% for star in range(1,full) %}
  18.                     {% sw_include '@Storefront/storefront/component/review/point.html.twig' with {
  19.                         type: 'full'
  20.                     } %}
  21.                 {% endfor %}
  22.             {% endif %}
  23.             {% if half %}
  24.                 {% sw_include '@Storefront/storefront/component/review/point.html.twig' with {
  25.                     type: 'half'
  26.                 } %}
  27.             {% endif %}
  28.             {% if blank > 0 %}
  29.                 {% for star in range(1,blank) %}
  30.                     {% sw_include '@Storefront/storefront/component/review/point.html.twig' with {
  31.                         type: 'blank'
  32.                     } %}
  33.                 {% endfor %}
  34.             {% endif %}
  35.         {# @deprecated tag:v6.5.0 - span will be a div #}
  36.         {% if feature('v6.5.0.0') %}
  37.             </div>
  38.         {% else %}
  39.             </span>
  40.         {% endif %}
  41.     {% endblock %}
  42. {% endblock %}