{% sw_extends '@Storefront/storefront/component/product/card/badges.html.twig' %}
{% block component_product_badges %}
{# <div class="product-badges">#}
{% block component_product_badges_discount %}
{% set price = product.calculatedPrice %}
{% if product.calculatedPrices.count > 0 %}
{% set price = product.calculatedPrices.last %}
{% endif %}
{% set listPrice = price.listPrice.percentage > 0 %}
{% set hasRange = product.calculatedPrices.count > 1 %}
{% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
{% if displayParent %}
{% set displayFromVariants = displayParent and price.unitPrice !== product.calculatedCheapestPrice.unitPrice %}
{% endif %}
{% if listPrice and not hasRange and not displayFromVariants %}
<div class="stickers">
{% if not displayFrom and not displayFromVariants %}
<div class="sticker_sale">%{{ price.listPrice.percentage|sw_sanitize }}</div>
{% else %}
<div class="sticker_sale">%</div>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% block component_product_badges_topseller %}
{% if product.markAsTopseller %}
<div class="stickers">
<div class="sticker_sale">{{ "listing.boxLabelTopseller"|trans|sw_sanitize }}</div>
</div>
{% endif %}
{% endblock %}
{% block component_product_badges_new %}
{% if product.isNew %}
<div class="stickers">
<div class="sticker_new">{{ "listing.boxLabelNew"|trans|sw_sanitize }}</div>
</div>
{% endif %}
{% endblock %}
{# </div>#}
{% endblock %}