{% extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{# Note: not all blocks have been included, please maintain block-structure while updating #}
{% 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 %}
{% set showCheapestPrice = theme_config('productListingStylesProductBoxDisplayCheapestPrice') %}
{% set hasMultiplePrices = product.cheapestPriceContainer.default.child_count > 0 %}
{% set showingCheapestPrice = cheapest.unitPrice ? hasMultiplePrices and showCheapestPrice : false %}
{# "cheapest price" has been merged with the regular price, we're never showing both at once. #}
{#<div class="product-cheapest-price">
{% if cheapest.unitPrice %}
<div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}</span></div>
{% endif %}
</div>#}
{% set isListPrice = price.listPrice.percentage > 0 %}
{# Reverse flex has been used to maintain the default hierarchy #}
<span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %} d-flex flex-row-reverse flex-wrap-reverse justify-content-end">
{% block component_product_box_price_wrapper %}
{% if showingCheapestPrice %}
<div class="product-price-cheapest">{{ cheapest.unitPrice|currency }}</div>
{% else %}
<div class="product-price-unit-price">{{ price.unitPrice|currency }}</div>
{% endif %}
{% endblock %}
{% block component_product_box_price_prefix_wrapper %}
<div class="product-price-prefix">
{% block component_product_box_price_prefix_content %}
{% block component_product_box_price_has_children_prefix %}
{% if showingCheapestPrice %}
<div class="product-price-from mr-2">
{{ "listing.listingTextFrom"|trans|sw_sanitize }}
</div>
{% endif %}
{% endblock %}
{% endblock %}
</div>
{% endblock %}
{% 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="lp-price list-price{% if hideStrikeTrough %} list-price-line-through{% endif %} pr-2 pl-0">
<span class="list-price-price">{{ price.listPrice.price|currency }}</span>
</span>
{% if theme_config('productListingStylesProductBoxDisplayPercentage') %}
{% block component_product_box_price_percentage_wrapper %}
<span class="lp-percentage list-price col-12 pr-0 pl-0">
{% block component_product_box_price_percentage_content %}
<span class="list-price-percentage">{{ "oo.detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
{% endblock %}
</span>
{% endblock %}
{% endif %}
{% endif %}
</span>
{% if isRegulationPrice %}
<span class="product-price with-regulation-price">
<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}</span>
</span>
{% endif %}
</div>
{% endblock %}