{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
{% 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 product.extensions["groups"].elements[0].options.elements and product.extensions["groups"].elements[0].options.elements|length > 0 %}
{% set variationCount = product.extensions["groups"].elements[0].options.elements|length %}
{% else %}
{% set variationCount = "" %}
{% endif %}
{% if product.cheapestPrice.variantId is not empty %}
{% set varId = product.cheapestPrice.variantId %}
{% else %}
{% set varId = id %}
{% endif %}
{#
<div class="product-cheapest-price{% if isListPrice and price.regulationPrice.price and not displayFrom %} with-list-price{% endif %}{% if isRegulationPrice and displayFrom %} with-regulation-price{% endif %}">
{% if cheapest.unitPrice != real.unitPrice %}
<div class="variation-from-price"><a title="{{ 'detail.cheapestVariationLink'|trans|sw_sanitize }}" href="{{ seoUrl('frontend.detail.page', {'productId': varId}) }}">{%if variationCount is not empty %}{{ variationCount }} {% endif %}{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}</a> <span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
{% endif %}
</div>
#}
{% if displayFrom %}
{# <a href="#" title="{{ "detail.staffelPreise"|trans|trim|sw_sanitize }}" class="category-price-table-link">{{ "listing.listingTextFrom"|trans|sw_sanitize }}</a> #}
<span class="category-price-table-link">{{ "listing.listingTextFrom"|trans|sw_sanitize }}</span>
{% endif %}
<span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
{{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
{% 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 }}{{ "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>
{% if displayFrom %}
{# <span style="display: inline-block; margin-right: 0; margin-left: auto;">{{ detail.staffelPreise }}</span> #}
<a href="#" title="{{ "detail.staffelPreise"|trans|trim|sw_sanitize }}"
class="category-price-table-link">{% sw_icon 'eye-open' style{"size":"xs"} %} {{ "detail.staffelPreise"|trans|sw_sanitize }}</a>
{% endif %}
{% 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>
{% sw_include '@Storefront/storefront/component/product/card/price-table.html.twig' with {
product: product,
price: price
} %}
{% endblock %}