custom/plugins/TomRockets/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.         {% sw_icon 'sale' style{
  15.             "pack":"category-page",
  16.             "namespace": "TomRockets"
  17.         } %}
  18.     {% endif %}
  19. {% endblock %}
  20. {% block component_product_badges_new %}
  21.     {% if product.isNew %}
  22.         {% sw_icon 'new' style{
  23.             "pack":"category-page",
  24.             "namespace": "TomRockets"
  25.         } %}
  26.     {% endif %}
  27. {% endblock %}