{{ $product->name }} @push('styles') @endpush
{{-- Breadcrumb --}}
{{-- Product Images --}}
@if($product->images->count()) @php $mainImage = $product->images->first(); @endphp
{{ $mainImage->alt_text ?: $product->name }}
@if($product->images->count() > 1)
@foreach($product->images as $img) @endforeach
@endif @else
🌿
@endif
{{-- Product Info --}}
{{-- Badge (Strictly fit-content width, never full width) --}} @if($product->badge)
{{ $product->badge === 'new' ? 'BARU' : ($product->badge === 'sale' ? 'SALE' : 'HABIS TERJUAL') }}
@endif @if($product->category)

{{ $product->category->name }}

@endif

{{ $product->name }}

{{-- Price & Stock calculation --}} @php $pdpVariations = $product->variations->count() ? $product->variations->values() : collect(); $firstVar = $pdpVariations->first(); $initialPrice = $firstVar ? $firstVar->price : $product->price; $initialStock = $firstVar ? (int) $firstVar->stock : (int) $product->stock; $isAvailable = ($initialStock > 0) || ($product->stock > 0) || ($pdpVariations->isNotEmpty() && $pdpVariations->sum('stock') > 0); @endphp
@if($pdpVariations->isNotEmpty())

Mulai dari

@endif

Rp {{ number_format($initialPrice, 0, ',', '.') }}

@if($product->compare_at_price && $product->compare_at_price > $initialPrice)

Rp {{ number_format($product->compare_at_price, 0, ',', '.') }}

@endif @if($product->badge === 'sale') SALE @endif
★ {{ number_format($averageRating, 1) }} ({{ $reviewCount }})
{{-- Stock status --}}
@if($initialStock > 0) ✓ Stok tersedia ({{ $initialStock }}) @else ✗ Stok habis @endif
{{-- Variants (weight) --}} @if($pdpVariations->isNotEmpty())

Pilih Berat / Varian

@foreach($pdpVariations as $i => $var) @endforeach
@endif {{-- Add to Cart & Buy Now Form --}}
@csrf @if($pdpVariations->isNotEmpty()) @endif {{-- Quantity Stepper --}}

Jumlah

7 Days Replacement
100% Organic
Chemical Free
Secure Payment
{{-- Action Buttons --}} @if($isAvailable)
@else @endif
@if($product->description) @php $descriptionHtml = \Illuminate\Support\Str::markdown($product->description, [ 'html_input' => 'strip', 'allow_unsafe_links' => false, ]); @endphp

Product information

Tentang {{ $product->name }}

@endif @if($recommendations->isNotEmpty())

Anda mungkin suka

Rekomendasi Produk

@if($product->category) Lihat semua @endif
@foreach($recommendations as $index => $recommendedProduct) @include('shop::components.layouts._product-card', ['product' => $recommendedProduct, 'index' => $index, 'bg' => ['#E8F0E5','#DCE8D6','#F0F5EC','#EAF1E4'][$index % 4]]) @endforeach
@endif

Customer feedback

Review Produk

{{ number_format($averageRating, 1) }} ★

{{ $reviewCount }} review disetujui

@if($reviews->isNotEmpty())
@foreach($reviews as $review)

{{ $review->customer_name ?: 'Pelanggan' }}

{{ optional($review->created_at)->format('d M Y') }}

{{ str_repeat('★', max(0, min(5, (int) $review->rating))) }}
@if($review->comment)

{{ $review->comment }}

@endif
@endforeach
@else

Belum ada review untuk produk ini.

Jadilah pelanggan pertama yang membagikan pengalaman.

@endif
@push('scripts') @endpush