Turkish content
This section is currently available in Turkish only. Component code and Twig variable names are language-independent.
Ürünün fiyat, indirimli fiyat ve indirim yüzdesinin değişkenleri
Görünüm

Kod Yapısı
HTML
{% if preferences.sales_allowed %}
<div class="product-price{% if product.isDiscounted %} has-discount{% endif %}">
{% if product.isDiscounted and preferences.sales_allowed %}
<div class="discount-label">%{{ product.discountPercent }}</div>
{% endif %}
<div class="d-flex align-items-baseline">
<div class="product-price-old">
{{ product.priceWithTax(preferences.default_currency) | money }} {{ preferences.default_currency }}
</div>
{% if product.isDiscounted and preferences.sales_allowed %}
<div class="product-price-new">
{{ product.discountedPriceWithTax(preferences.default_currency) | money }} {{ preferences.default_currency }}
</div>
{% endif %}
</div>
</div>
{% endif %}
SCSS
.product-price {
display: flex;
align-items: center;
&-new,
&-old {
color: $color-primary;
font-size: var(--font-size-24);
font-weight: 700;
}
&.has-discount {
.product-price-old {
color: $color-sub-text;
font-size: var(--font-size-18);
text-decoration: line-through;
margin-right: var(--spacer-4);
}
}
.discount-label {
display: flex;
align-items: center;
height: 24px;
color: $color-white;
padding: 0 10px;
margin-right: var(--spacer-4);
background-color: $color-third;
}
}
Last modified on