{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% block component_product_box_price_reference_unit %}
{% endblock %}
{% block component_product_box_price_purchase_unit %}
{% endblock %}
{% block component_product_box_price %}
<p class="price-unit-content">
{{ "listing.boxUnitLabel"|trans|sw_sanitize }} {{ purchaseUnit }} {{ product.unit.translated.shortCode }}{% if product.translated.customFields.custom_entspricht_ %}<span> ({{ product.translated.customFields.custom_entspricht_ }})</span>{% endif %}
</p>
<div class="product-price-wrapper">
{% set price = real %}
{% set purchaseUnit = product.purchaseUnit %}
{% set listingPrice = product.calculatedListingPrice %}
{% set fromPrice = listingPrice.from %}
{% set referncePrice = product.calculatedPrice.referencePrice %}
<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 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>
{% 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>
{% if referncePrice is not null %}
<span class="price-unit-reference">
{% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
({{ "listing.listingTextFrom"|trans|sw_sanitize }} {{ fromPrice.referencePrice.price|currency }} / {{ fromPrice.referencePrice.referenceUnit }} {{ product.unit.translated.shortCode }})
{% else %}
({{ referncePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ referncePrice.referenceUnit }} {{ product.unit.translated.shortCode }})
{% endif %}
</span>
{% endif %}
{% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
<span class="price-unit-reference">{{ "general.star"|trans|sw_sanitize }}</span>
{% else %}
<span class="product-price">{{ "general.star"|trans|sw_sanitize }}</span>
{% endif %}
</div>
{% endblock %}
{% block component_product_box_price_unit %}
{% endblock %}