custom/apps/AtlKatanaTheme/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.     {% block component_product_badges_manufacturer %}
  4.         {% set manufacturerName = product.manufacturer.translated.name %}
  5.         {% if theme_config('atl-cms-product-box-show-manufacturer-badge') == 'true' and manufacturerName and activeRoute != 'frontend.detail.page' %}
  6.             <div>
  7.                 <span class="badge badge-primary badge-manufacturer">{{ manufacturerName }}</span>
  8.             </div>
  9.         {% endif %}
  10.     {% endblock %}
  11.     {% set price = product.calculatedPrice %}
  12.     {% if product.calculatedPrices.count > 0 %}
  13.         {% set price = product.calculatedPrices.last %}
  14.     {% endif %}
  15.     {% set listPrice = price.listPrice.percentage > 0 %}
  16.     {% set hasRange = product.calculatedPrices.count > 1 %}
  17.     {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
  18.     {% if displayParent %}
  19.         {% set displayFromVariants = displayParent and price.unitPrice !== product.calculatedCheapestPrice.unitPrice %}
  20.     {% endif %}
  21.     {% if theme_config('atl-cms-product-box-show-discount-badge') == 'true' and listPrice and not hasRange and not displayFromVariants %}
  22.         <div>
  23.             <span class="badge badge-danger badge-discount">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage|round })|sw_sanitize }}</span>
  24.         </div>
  25.     {% endif %}
  26. {% endblock %}