custom/plugins/Lichtkarree/src/Resources/views/storefront/component/product/card/badges.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/badges.html.twig' %}
  2. {% block component_product_badges %}
  3.     <div class="product-badges">
  4.         {% block component_product_badges_discount %}
  5.             {% set price = product.calculatedPrice %}
  6.             {% if product.calculatedPrices.count > 0 %}
  7.                 {% set price = product.calculatedPrices.last %}
  8.             {% endif %}
  9.             {% set listPrice = price.listPrice.percentage > 0 %}
  10.             {% set hasRange = product.calculatedPrices.count > 1 %}
  11.             {% if listPrice and not hasRange %}
  12.                 <div class="badge badge-discount">
  13.                     <span>-{{ product.price.elements.b7d2554b0ce847cd82f3ac9bd1c0dfca.percentage.gross|round(0, 'ceil')|replace({'.':','}) }}%</span>
  14.                 </div>
  15.             {% endif %}
  16.         {% endblock %}
  17.         {% block component_product_badges_topseller %}
  18.             {% if product.markAsTopseller %}
  19.                 <div>
  20.                     <span class="badge badge-warning badge-topseller">{{ "listing.boxLabelTopseller"|trans|sw_sanitize }}</span>
  21.                 </div>
  22.             {% endif %}
  23.         {% endblock %}
  24.         {% block component_product_badges_new %}
  25.             {% if product.isNew %}
  26.                 <div>
  27.                     <span class="badge badge-success badge-new">{{ "listing.boxLabelNew"|trans|sw_sanitize }}</span>
  28.                 </div>
  29.             {% endif %}
  30.         {% endblock %}
  31.     </div>
  32. {% endblock %}