custom/plugins/AcrisPromotionCS/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.     {% if product.extensions.acrisProductBadges is null or product.extensions.acrisProductBadges.elements|length == 0 %}
  4.         {% set price = product.calculatedPrice %}
  5.         {% if product.calculatedPrices.count > 0 %}
  6.             {% set price = product.calculatedPrices.last %}
  7.         {% endif %}
  8.         {% set listPrice = price.listPrice.percentage > 0 %}
  9.         {% set hasRange = product.calculatedPrices.count > 1 %}
  10.         {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
  11.         {% if displayParent %}
  12.             {% set displayFromVariants = displayParent and price.unitPrice !== product.calculatedCheapestPrice.unitPrice %}
  13.         {% endif %}
  14.         {% set cheapest = product.calculatedCheapestPrice %}
  15.         {% set cheapestListPrice = cheapest.listPrice.percentage > 0 %}
  16.         {% if (listPrice and not displayFromVariants) or (cheapestListPrice and displayFromVariants) %}
  17.             {% if not listPrice or hasRange or displayFromVariants %}
  18.                 <div class="badge badge-danger badge-discount">
  19.                     <span>&#37;</span>
  20.                 </div>
  21.             {% endif %}
  22.             {{ parent() }}
  23.         {% else %}
  24.             {{ parent() }}
  25.         {% endif %}
  26.     {% else %}
  27.         {{ parent() }}
  28.     {% endif %}
  29. {% endblock %}