custom/plugins/econdWebAnalytics/src/Resources/views/storefront/component/review/rating.html.twig line 1

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