{% sw_extends '@Storefront/storefront/component/product/card/badges.html.twig' %}
{% block component_product_badges_discount %}
{% set listPrice = product.priceRange or product.calculatedPrices.count > 0 ? null : product.calculatedPrice.listPrice.percentage > 0 %}
{% if product.translated.customFields.custom_same_day_checkbox %}
<div class="badge-same-day">
<span class="badge">{{ "wlcustom.product_box.same_day"|trans }}</span>
</div>
{% endif %}
{% if product.translated.customFields.custom_lokal_lokal_ or product.translated.customFields.custom_lokal_region_ %}
{% if (product.translated.customFields.custom_lokal_lokal_ and product.translated.customFields.custom_lokal_region_) or (product.translated.customFields.custom_lokal_lokal_ and product.translated.customFields.custom_lokal_region_ == false) %}
<div class="badge-lokal">
<span class="badge">Lokales Produkt</span>
</div>
{% endif %}
{% if (product.translated.customFields.custom_lokal_lokal_ == false) and product.translated.customFields.custom_lokal_region_ %}
<div class="badge-lokal">
<span class="badge">Aus der Region</span>
</div>
{% endif %}
{% endif %}
{% if listPrice or product.isNew %}
{% if (product.isNew and listPrice) or (product.isNew and listPrice == false) %}
<div class="badge-success">
<span class="badge badge-new">{{ "listing.boxLabelNew"|trans|sw_sanitize }}</span>
</div>
{% endif %}
{% if (product.isNew == false and listPrice) %}
<div class="badge-danger">
<span class="badge badge-discount">Sale</span>
</div>
{% endif %}
{% endif %}
{% endblock %}
{% block component_product_badges_new %}
{% endblock %}