custom/plugins/LogBchange/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_discount %}
  3.     {% set price = product.calculatedPrice %}
  4.     {% if product.calculatedPrices.count > 0 %}
  5.         {% set price = product.calculatedPrices.last %}
  6.     {% endif %}
  7.     {% set listPrice = price.listPrice.percentage > 0 %}
  8.     {% set hasRange = product.calculatedPrices.count > 1 %}
  9.     {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
  10.     {% if displayParent %}
  11.         {% set displayFromVariants = displayParent and price.unitPrice !== product.calculatedCheapestPrice.unitPrice %}
  12.     {% endif %}
  13.     {% if listPrice and not hasRange and not displayFromVariants %}
  14.         <div>
  15.             <span class="badge badge-danger badge-discount">-
  16.                 {{ price.listPrice.percentage }}&#37;</span>
  17.         </div>
  18.     {% endif %}
  19. {% endblock %}
  20. {% block component_product_badges_topseller %}
  21.     {% if product.markAsTopseller %}
  22.         <div>
  23.             <span class="badge badge-warning badge-topseller">{{ "listing.boxLabelTopseller"|trans|sw_sanitize|upper }}</span>
  24.         </div>
  25.     {% endif %}
  26. {% endblock %}
  27. {% block component_product_badges_new %}
  28.     {% if product.isNew %}
  29.         <div>
  30.             <span class="badge badge-success badge-new">{{ "listing.boxLabelNew"|trans|sw_sanitize|upper }}</span>
  31.         </div>
  32.     {% endif %}
  33. {% endblock %}