{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}

{% set variant = product|sylius_resolve_variant %}
{% set hasDiscount = variant|sylius_has_discount({'channel': sylius.channel}) %}

<span class="ui header" id="product-original-price"{% if not hasDiscount %} style="display: none;"{% endif %} {{ sylius_test_html_attribute('product-original-price', money.calculateOriginalPrice(variant)) }}>
    {% if hasDiscount %}
        <del>{{ money.calculateOriginalPrice(variant) }}</del>
    {% endif %}
</span>

<span class="ui huge header" id="product-price" {{ sylius_test_html_attribute('product-price', money.calculatePrice(variant)) }}>
    {{ money.calculatePrice(variant) }}
</span>

{% set days = sylius.channel.channelPriceHistoryConfig.lowestPriceForDiscountedProductsCheckingPeriod %}
{% set hasLowestPrice = variant|sylius_has_lowest_price({'channel': sylius.channel})%}

<div class="ui mini label" id="lowest-price-before-discount"
    {% if hasDiscount and hasLowestPrice %}
        style="white-space: nowrap"
    {% else %}
        style="display: none;"
    {% endif %}
>
    {% if hasDiscount and hasLowestPrice %}
        {{ 'sylius.ui.lowest_price_days_before_discount_was'|trans({'%days%': days, '%price%': money.calculateLowestPrice(variant)}) }}
    {% endif %}
</div>
