{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% block component_product_box_price_unit %}
{% endblock %}
{% block component_product_box_price %}
<div class="product-price-wrapper">
{% set price = real %}
{% set isListPrice = price.listPrice.percentage > 0 %}
{% set isRegulationPrice = price.regulationPrice != null %}
{% if displayFrom %}
{{ "listing.listingTextFrom"|trans|sw_sanitize }}
{% endif %}
<span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
{{ price.unitPrice|currency }}
{% if isListPrice and not displayFrom %}
{% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
{% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
{% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
<span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
{% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-price">{{ price.listPrice.price|currency }}</span>
</span>
{% endif %}
</span>
{% if isRegulationPrice %}
<span class="product-price with-regulation-price">
{% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}</span>
</span>
{% endif %}
<p class="product-price-unit">
{# Price is based on the purchase unit #}
{% block component_product_box_price_purchase_unit %}
{% endblock %}
{# Item price is based on a reference unit #}
{% block component_product_box_price_reference_unit %}
{% if referencePrice is not null %}
<span class="price-unit-reference">
{{ referencePrice.price|currency }} / {{ referencePrice.referenceUnit }} {{ referencePrice.unitName }}
</span>
{% endif %}
{% endblock %}
</p>
</div>
{% endblock %}