# Adet Özellikleri

Ürünün adet değişkenleri

## Görünüm

![Adet Özellikleri](/img/tema/856974746.png)

## Kod Yapısı

Ürüne ait 3 farklı adet özelliği mevcuttur. Bu özellikleri admin panelinden **Ayarlar** / **Tasarım Ayarları** kısmından aktif olan temanın tema ayarlarına ulaşarak kullanabilirsiniz.

Ürün adet seçim tipi başlığındaki 3 farklı seçimde şunlar bulunmaktadır:

- Aşağı Açılır Liste
- Metin Kutusu
- \- Adet +

Aşağıda bu 3 özelliğin kodları yer almaktadır.

### HTML

```twig title="index.html"
{% if preferences.sales_allowed %}
    {% if product.isAvailableForSales %}
        {% if theme.settings.qtytype == 'select' or theme.settings.qtytype == "textbox" or theme.settings.qtytype == "plusminus" %}
            {% if theme.settings.qtytype == "select" %}
                <div class="product-qty-wrapper product-qty-wrapper-select">
                    <div class="product-qty" data-selector="qty-wrapper">
                        <select name="qty-input" id="qty-input" data-selector="qty" data-context="detail" data-stocktype="{{ product.stockTypeLabel }}" data-stockamount='{{ product.stockAmount }}' value="1" aria-label="Quantity">
                            {% for i in 1..10 %}
                                <option value="{{ i }}">{{ i }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
            {% elseif theme.settings.qtytype == "textbox" %}
                <div class="product-qty-wrapper product-qty-wrapper-select">
                    <div class="product-qty" data-selector="qty-wrapper">
                        <div>
                            <input type="text" id="qty-input" data-selector="qty" data-context="detail" data-stocktype="{{ product.stockTypeLabel }}" data-stockamount='{{ product.stockAmount }}' value="1" aria-label="Quantity" autocomplete="off">
                        </div>
                    </div>
                </div>
            {% elseif theme.settings.qtytype == "plusminus" %}
                <div class="product-qty-wrapper">
                    <div class="product-qty" data-selector="qty-wrapper">
                        <a href="javascript:void(0)" data-selector="decrease-qty" aria-label="Decrease Quantity">
                            <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
                                <path d="M2.5 8H13.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
                            </svg>
                        </a>
                        <div>
                            <input type="text" id="qty-input" data-selector="qty" data-context="detail" data-stocktype="{{ product.stockTypeLabel }}" data-stockamount='{{ product.stockAmount }}' value="1" aria-label="Quantity" autocomplete="off">
                        </div>
                        <a href="javascript:void(0)" data-selector="increase-qty" aria-label="Increase Quantity">
                            <svg width="16" height="16" viewBox="0 0 16 16" fill="none">
                                <path d="M2.5 8H13.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 2.5V13.5" stroke="#333333" stroke-linecap="round" stroke-linejoin="round"/>
                            </svg>
                        </a>
                    </div>
                </div>
            {% endif %}
        {% endif %}
    {% endif %}
{% endif %}
```

### SCSS

```scss title="style.css"
.product-qty-wrapper {
	.product-qty {
		display: flex;
		flex-wrap: wrap;
		width: 165px;
		height: 48px;
        border: 1px solid $color-border;
        border-radius: $border-radius;
        background-color: $color-white;
		> a {
			flex: 0 0 40px;
			max-width: 40px;
			@include center;
            color: $color-text;
            @include max($sm) {
                flex: 0 0 55px;
                max-width: 55px;
            }
		}
		> div {
			flex: 1 0 0;
			max-width: 100%;
			input {
				width: 100%;
				height: 100%;
                color: $color-text;
				font-size: var(--font-size-16);
                font-weight: 600;
				text-align: center;
                border: none;
				background-color: #fff;
			}
        }
	}
    &.product-qty-wrapper-select {
        .product-qty {
            border: none;
            border-radius: 0;
            select.form-control:not([size]):not([multiple]),
            select:not([size]) {
                height: 48px;
                color: $color-text;
                font-size: var(--font-size-14);
                font-weight: 400;
                cursor: pointer;
                padding: 6px 28px 6px 20px;
                border: 1px solid $color-border;
                border-radius: $border-radius;
                background-color: $color-white;
                background-image: url("{{ themeAsset('images/icon-selectbox.svg') }}");
                background-size: 36px;
            }
            > div {
                input {
                    height: 48px;
                    border: 1px solid $color-border;
                    border-radius: $border-radius;
                    background-color: $color-white;
                }
            }
        }
    }
	@include max($xs) {
		margin-bottom: var(--spacer-8);
		flex: 0 0 100%;
		max-width: 100%;
		.product-qty {
			width: 100%;
		}
	}
}
```

### JSON

```json title="index.js"
"qtytype": {
    "type": "select",
    "default_value": "plusminus",
    "options": [
        {
            "label": "Aşağı açılır liste",
            "value": "select"
        },
        {
            "label": "Metin Kutusu",
            "value": "textbox"
        },
        {
            "label": "- Adet +",
            "value": "plusminus"
        },
        {
            "label": "Adet Seçimini Kapat",
            "value": "none"
        }
    ],
    "label": "Ürün Adet Seçim Tipi"
},
```
