{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% block component_product_box_price %}
<div class="product-price-wrapper">
{# Custom switch, this is made for Shop The Look products. As Shop #}
{% if product.calculatedPrice %}
{# Original prices, default shopware #}
{% set price = real %}
{% set isListPrice = price.listPrice.percentage > 0 %}
{% set unitPrice = price.unitPrice %}
{% set listPrice = price.listPrice.price %}
{% else %}
{# Custom prices, for products that are included by Shop The Look #}
{% set price = product.price.elements|first %}
{% set isListPrice = price.gross < price.listPrice.gross %}
{% set unitPrice = price.gross %}
{% set listPrice = price.listPrice.gross %}
{% endif %}
{% if displayFrom %}
{{ "listing.listingTextFrom"|trans|sw_sanitize }}
{% endif %}
{% if isListPrice and not displayFrom %}
<span class="list-price original-price text-xs lg:text-sm line-through mr-1 md:mr-2">
{{ listPrice|number_format(2, ',', '')|replace({',00': ',-'}) }}
</span>
{% endif %}
<span class="product-price current-price inline-block text-xs lg:text-sm{% if isListPrice and not displayFrom %} sale-price text-red-500 font-bold{% else %} text-grey-600{% endif %}">
{{ unitPrice|number_format(2, ',', '')|replace({',00': ',-'}) }}
</span>
</div>
{% endblock %}