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

{% if variant is not defined %}
    {% if configuration.vars.variantCode is defined %}
        {% set variant = product|dedi_theme_resolve_variant_with_code(configuration.vars.variantCode) %}
    {% else %}
        {% set variant = product|sylius_resolve_variant %}
    {% endif %}
{% endif %}

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

<span class="product-price {% if hasDiscount %}promo{% endif %}" id="product-price" {{ sylius_test_html_attribute('product-price', money.calculatePrice(variant)) }}>
    {{ money.calculatePrice(variant) }}
</span>
{% if hasDiscount %}
    <span class="product-price-old">{{ money.calculateOriginalPrice(variant) }}</span>
{% endif %}
