{{-- Seçenekler --}} @if($hasVariants)
@foreach($product->options as $option)
{{ $option->name }}: @if(!empty($selectedOptions[$option->id])) {{ $option->values->firstWhere('id', $selectedOptions[$option->id])?->value }} @endif
@foreach($option->values as $val) @php $isActive = !empty($selectedOptions[$option->id]) && $selectedOptions[$option->id] == $val->id; $isDisabled = $this->isOptionValueDisabled($option->id, $val->id); @endphp @endforeach
@endforeach
@endif {{-- Fiyat Grubu --}}
@if($currentPrice === null || $currentPrice <= 0) Fiyat Sorun @elseif($currentDiscountPrice !== null && $currentDiscountPrice < $currentPrice) {{ number_format($currentDiscountPrice, 2, ',', '.') }} TL {{ number_format($currentPrice, 2, ',', '.') }} TL @php $discountPercent = $currentPrice > 0 ? (int) round((1 - $currentDiscountPrice / $currentPrice) * 100) : 0; @endphp %{{ $discountPercent }} İndirim @else {{ number_format($currentPrice, 2, ',', '.') }} TL @endif
{{-- Hata / Durum Hesaplama --}} @php $allSelected = true; if ($hasVariants) { foreach ($product->options as $option) { if (empty($selectedOptions[$option->id])) { $allSelected = false; break; } } } $variantFound = !$hasVariants || !empty($product_variant_id); $isInStock = false; if ($hasVariants) { if ($allSelected && $variantFound) { $isInStock = $currentStockStatus === 'in_stock' && $currentStock > 0; } } else { $isInStock = $product->is_in_stock; } @endphp @if($hasVariants && $allSelected && !$variantFound)
Bu seçenek kombinasyonu mevcut değil.
@endif {{-- Miktar Seçimi ve Sepete Ekle --}} @if($product->price === null || $product->price <= 0)
@elseif(($hasVariants && $allSelected && $variantFound && $isInStock) || (!$hasVariants && $isInStock))
@else
@endif
* Ödeme ve sipariş oluşturma adımları bir sonraki aşamalarda aktif olacaktır.