{% sw_extends '@Storefront/storefront/page/product-detail/buy-widget-price.html.twig' %}
{% block page_product_detail_price_content %}
{% set listPrice = price.listPrice %}
{% set isListPrice = listPrice.percentage > 0 %}
{% set isRegulationPrice = price.regulationPrice != null %}
{% set purchaseUnit = page.product.purchaseUnit %}
{% set productUnitAkeneoKey = page.product.unit.translated.customFields["akeneo_key"] %}
{% set enableUnitConversion = productUnitAkeneoKey !== "set" and productUnitAkeneoKey !== "box" and purchaseUnit !== 1.0 %}
{% set isDiscounted = listPrice.discount < 0 %}
{# @fourtwosix-edit: FV: imported custom fields value #}
{% set showPrice = page.product.translated.customFields['akeneo_statusinshoppreiszeigen'] ?? true %}
{# @fourtwosix-edit: FV: hide price if condition showPrice is false #}
{% if showPrice %}
<p class="product-detail-price
{% if isDiscounted and enableUnitConversion or not isDiscounted and not enableUnitConversion %} price-original-discount{% elseif not isDiscounted and enableUnitConversion %} price-original{% endif %}
{% if isListPrice %} with-list-price{% endif %}
{% if isRegulationPrice %} with-regulation-price{% endif %}">
{{ (page.product.calculatedPrice.totalprice)|currency }}
/
{% if enableUnitConversion %}
{{ "fts.unit.box"|trans }}
{% else %}
{{ page.product.unit.translated.name }}
{% endif %}
{{ "general.star"|trans|sw_sanitize }}
</p>
{% if isListPrice %}
{% block page_product_detail_was_price %}
{{ block("page_product_detail_was_price_badge") }}
{% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
{% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
{% block page_product_detail_was_price_wrapper %}{% endblock %}
{% endblock %}
{% endif %}
{% if isRegulationPrice %}
<span class="product-detail-list-price-wrapper">
<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
</span>
{% endif %}
{% endif %}
{% endblock %}
{% block page_product_detail_price_unit_reference_content %}{% endblock %}