{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% block component_product_box_price %}
{% set price = real %}
{% set isListPrice = price.listPrice.percentage > 0 %}
{% set isCheapestListPrice = cheapest.listPrice.percentage > 0 %}
{% set isRegulationPrice = price.regulationPrice != null %}
{% if isListPrice and displayFrom %}
<div class="product-price-wrapper">
{% set price = real %}
<div class="product-cheapest-price">
{% if cheapest.unitPrice != real.unitPrice %}
<div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
{% endif %}
</div>
{% if displayFrom %}
{{ "listing.listingTextFrom"|trans|sw_sanitize }}
{% endif %}
{% set isListPrice = price.listPrice.percentage > 0 %}
<span class="product-price{% if isListPrice %} with-list-price{% endif %}">
{{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
{% if isListPrice %}
{% 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 }}{{ "general.star"|trans|sw_sanitize }}</span>
{% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
</span>
{% endif %}
</span>
</div>
{% else %}
{% if isListPrice and not displayFrom %}
{% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
{% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
{% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
<div class="product-price-wrapper">
<div class="product-cheapest-price {% if isListPrice and isRegulationPrice and not displayFrom %} with-list-price{% endif %}{% if isRegulationPrice and not displayFrom %} with-regulation-price{% endif %}{% if displayFrom and isRegulationPrice %} with-from-price{% endif %}">
{% if cheapest.unitPrice != real.unitPrice %}
<div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}
<span class="product-cheapest-price-price"> {% if isCheapestListPrice %}<span class="acris-promotion-discount-price">{{ cheapest.unitPrice|currency }}</span>{% else %}{{ cheapest.unitPrice|currency }}{% endif %}{{ "general.star"|trans|sw_sanitize }}
{% if isCheapestListPrice %}
<span class="product-price{% if isCheapestListPrice and not displayFrom %} with-list-price{% endif %}">
<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">{{ cheapest.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
{% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': cheapest.listPrice.percentage })|sw_sanitize }}</span>
</span>
</span>
{% endif %}
</span>
</div>
{% endif %}
</div>
{% if displayFrom or displayParent %}
{{ "listing.listingTextFrom"|trans|sw_sanitize }}
{% endif %}
<span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
{{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
<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 }}{{ "general.star"|trans|sw_sanitize }}</span>
{% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
<span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
</span>
</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 }) }}{{ "general.star"|trans|sw_sanitize }}</span>
</span>
{% endif %}
</div>
{% else %}
{{ parent() }}
{% endif %}
{% endif %}
{% endblock %}