{% sw_extends "@Storefront/storefront/page/product-detail/buy-widget-price.html.twig" %}
{% block page_product_detail_price_inner %}
{% if page.product.calculatedPrices|length > 1 %}
{% block page_product_detail_price_block %}
{{ parent() }}
{% endblock %}
{% else %}
{% set price = page.product.calculatedPrice %}
{% if page.product.calculatedPrices|length == 1 %}
{% set price = page.product.calculatedPrices.first %}
{% endif %}
<meta itemprop="price"
content="{{ price.unitPrice }}">
{% if taxText %}
<p class="product-detail-tax-text m-0">{{ taxText }}</p>
{% endif %}
{% block page_product_detail_price_content %}
{% set listPrice = price.listPrice %}
<p class="product-detail-price-container d-flex flex-wrap text-right">
{% if listPrice.percentage > 0 %}
{% block page_product_detail_was_price %}
{% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|trim|sw_sanitize %}
{% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|trim|sw_sanitize %}
{% if beforeListPriceSnippetExists is same as("listing.beforeListPrice") %}
{% set beforeListPriceSnippetExists = "" %}
{% elseif afterListPriceSnippetExists is same as("listing.afterListPrice") %}
{% set afterListPriceSnippetExists = "" %}
{% endif %}
{% block page_product_detail_was_price_wrapper %}
<span class="product-detail-price-indicator">
{% if beforeListPriceSnippetExists %}
<strong>{{ beforeListPriceSnippetExists }}</strong>
{% endif %}
<span{% if not (afterListPriceSnippetExists or beforeListPriceSnippetExists) %} class="list-price-price"{% endif %}>{{ listPrice.price|currency }}</span>
{% if afterListPriceSnippetExists %}
<strong>{{ afterListPriceSnippetExists }}</strong>
{% endif %}
</span>
{% endblock %}
{% endblock %}
{% endif %}
{% set taxBase = price.calculatedTaxes|first %}
{% if context.taxState == "gross" %}
{% set unitPriceExclVat = (taxBase.price - taxBase.tax) %}
{% else %}
{% set unitPriceExclVat = price.unitPrice %}
{% endif %}
<span class="product-detail-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}">
{{ unitPriceExclVat|currency }}
</span>
</p>
{% if page.product.translated.customFields.deposit %}
{% set deposit = page.product.translated.customFields.deposit|currency %}
{% set depositWithTax = (page.product.translated.customFields.deposit + page.product.translated.customFields.deposit * page.product.tax.taxRate / 100)|currency %}
<div class="product-detail-deposit">
{{ "cytex-theme.product.detail.deposit.depositWithTax"|trans({
'%deposit%': depositWithTax
})|sw_sanitize }}
</div>
<div class="product-detail-deposit">
{{ "cytex-theme.product.detail.deposit.depositWithoutTax"|trans({
'%deposit%': deposit
})|sw_sanitize }}
</div>
{% endif %}
{% endblock %}
{% set taxBase = price.calculatedTaxes|first %}
{% if context.taxState == "gross" %}
{% set unitPriceInclVat = (taxBase.price) %}
{% else %}
{% set unitPriceInclVat = (taxBase.price + taxBase.tax) %}
{% endif %}
{% block page_product_detail_price_vat %}
{% if unitPriceInclVat %}
({{ "listing.moms-pre-text"|trans|sw_sanitize }} {{ unitPriceInclVat|currency }})
{% endif %}
{% endblock %}
{% if page.product.purchaseUnit %}
{% block page_product_detail_price_unit %}
{{ parent() }}
{% endblock %}
{% endif %}
{% endif %}
{% endblock %}