Ürün Vitrini
Ürün Görseli
Görünüm

Kod Yapısı
HTML
index.html<div class="showcase-image-container"> <a class="showcase-label-container" href="{{ item.product.url }}" aria-label="Product Detail"> {% if item.product.realAmount == 0 %} <div class="sold-out-label"><span>{{ theme.settings.label_soldout }}</span></div> {% else %} <div class="showcase-label-group"> {% if item.product.isDiscounted and preferences.sales_allowed %} <div class="discount-label">%{{ item.product.discountPercent }}</div> {% endif %} {% if item.product.isNew %} <div class="new-label">{{ theme.settings.label_new }}</div> {% endif %} {% if item.product.hasGift %} <div class="gift-label">{{ theme.settings.label_gift }}</div> {% endif %} </div> {% endif %} </a> <div class="showcase-image"> <a href="{{ item.product.url }}" title="{{ item.product.fullName }}"> {% if theme.settings.use_lazy_load %} <img class="lazyload" src="{{ themeAsset('images/loader.gif') }}" data-src="{{ item.product.primaryImage.thumbUrl | default(getNopicImageUrl()) }}" alt="{{ item.product.fullName }}"> {% else %} <img src="{{ item.product.primaryImage.thumbUrl | default(getNopicImageUrl()) }}" alt="{{ item.product.fullName }}"> {% endif %} </a> </div> </div>
SCSS
style.css.showcase-image-container { position: relative; a.showcase-label-container { .showcase-label-group { position: absolute; left: var(--spacer-3); top: var(--spacer-3); z-index: 20; display: flex; flex-direction: column; align-items: flex-start; > div { display: flex; align-items: center; height: 24px; color: $color-white; padding: 0 var(--spacer-2); margin-bottom: var(--spacer-1); &:last-child { margin-bottom: 0; } &.discount-label { background-color: $color-third; } &.new-label { background-color: $color-fourth; } &.gift-label { background-color: $color-fifth; } @include max($sm) { height: 20px; } } } .sold-out-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 20; display: flex; align-items: center; height: 24px; color: $color-white; padding: 0 var(--spacer-2); background-color: $color-text; } } } .showcase-image { a { position: relative; display: block; overflow: hidden; aspect-ratio: $aspect-ratio; background: $color-white; @include imgcenter; } }
JSON
index.js"label_new": { "type": "text", "default_value": "Yeni", "label": "Yeni Etiketi" }, "label_gift": { "type": "text", "default_value": "Hediyeli", "label": "Hediyeli Etiketi" }, "label_soldout": { "type": "text", "default_value": "Tükendi", "label": "Tükendi Etiketi" },
Son güncelleme: