{% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}{% block component_product_box_price_info %} {# @deprecated tag:v6.5.0 - purchaseUnit will be removed, use product.purchaseUnit if needed #} {% set purchaseUnit = product.purchaseUnit %} {# @deprecated tag:v6.5.0 - listingPrice will be removed without replacement, since it was removed from the product struct #} {% set listingPrice = product.calculatedListingPrice %} {# @deprecated tag:v6.5.0 - fromPrice will be removed without replacement #} {% set fromPrice = listingPrice.from %} {% set cheapest = product.calculatedCheapestPrice %} {% set real = product.calculatedPrice %} {% if product.calculatedPrices.count > 0 %} {% set real = product.calculatedPrices.last %} {% endif %} {% set referencePrice = real.referencePrice %} {% set displayFrom = product.calculatedPrices.count > 1 %} {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %} {% if displayParent %} {% set displayFromVariants = displayParent and real.unitPrice !== cheapest.unitPrice %} {% set real = cheapest %} {% endif %} {% block component_product_box_price_unit %} <div class=""> {# Price is based on the purchase unit #} {% block component_product_box_price_purchase_unit %} {% if referencePrice and referencePrice.unitName %} {{ "listing.boxUnitLabel"|trans|sw_sanitize }} {{ referencePrice.purchaseUnit }} {{ referencePrice.unitName }} {% endif %} {% endblock %} {# Item price is based on a reference unit #} {% block component_product_box_price_reference_unit %} {% if referencePrice is not null %} ({{ referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ referencePrice.referenceUnit }} {{ referencePrice.unitName }}) {% endif %} {% endblock %} </div> {% endblock %} {% block component_product_box_price %} {% set price = real %} {% set isListPrice = price.listPrice.percentage > 0 %} {% set isRegulationPrice = price.regulationPrice != null %} {% if cheapest.unitPrice != real.unitPrice %} <div class="current_price"> {{ "listing.cheapestPriceLabel"|trans|sw_sanitize }} {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</div> {% endif %} {% if displayFrom or (displayParent and displayFromVariants) %} {{ "listing.listingTextFrom"|trans|sw_sanitize }} {% endif %} {% if isListPrice and not displayFrom and not displayFromVariants %} {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %} {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %} {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %} {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %} <div class="old_price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</div> {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %} {% endif %} <div class="current_price"> {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }} {% if isListPrice and not displayFrom and not displayFromVariants %} <small>{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</small> {% endif %} </div> {% 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 %} {% endblock %}{% endblock %}