custom/plugins/HyBuys/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.             {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
  12.             {% if displayParent %}
  13.                 {% set displayFromVariants = displayParent and price.unitPrice !== product.calculatedCheapestPrice.unitPrice %}
  14.             {% endif %}
  15.             {% if listPrice and not hasRange and not displayFromVariants %}
  16.                 <div class="stickers">
  17.                     {% if not displayFrom and not displayFromVariants %}
  18.                         <div class="sticker_sale">&#37;{{ price.listPrice.percentage|sw_sanitize }}</div>
  19.                     {% else %}
  20.                         <div class="sticker_sale">&#37;</div>
  21.                     {% endif %}
  22.                 </div>
  23.             {% endif %}
  24.         {% endblock %}
  25.         {% block component_product_badges_topseller %}
  26.             {% if product.markAsTopseller %}
  27.                 <div class="stickers">
  28.                     <div class="sticker_sale">{{ "listing.boxLabelTopseller"|trans|sw_sanitize }}</div>
  29.                 </div>
  30.             {% endif %}
  31.         {% endblock %}
  32.         {% block component_product_badges_new %}
  33.             {% if product.isNew %}
  34.                 <div class="stickers">
  35.                     <div class="sticker_new">{{ "listing.boxLabelNew"|trans|sw_sanitize }}</div>
  36.                 </div>
  37.             {% endif %}
  38.         {% endblock %}
  39. {#    </div>#}
  40. {% endblock %}