@extends('layouts.shop') @section('title', ($product->meta_title ?: $product->name).' — '.setting('site_name', 'BambooNest')) @section('meta_description', $product->meta_description ?: $product->short_description) @php $images = $product->images->isNotEmpty() ? $product->images->map(fn ($i) => ['url' => $i->url, 'alt' => $i->alt ?: $product->name])->values()->all() : [['url' => $product->image_url, 'alt' => $product->name]]; $variantsData = $product->variants->map(fn ($v) => [ 'id' => $v->id, 'name' => $v->name, 'sku' => $v->sku, 'price' => (float) ($v->price ?? $product->price), 'compare' => (float) ($v->compare_at_price ?? $product->compare_at_price ?? 0), 'stock' => (int) $v->stock, ])->values()->all(); $cfg = [ 'id' => $product->id, 'price' => (float) $product->price, 'compare' => (float) ($product->compare_at_price ?? 0), 'stock' => (int) $product->stock, 'tracked' => (bool) $product->track_inventory, 'backorder' => (bool) $product->allow_backorder, 'images' => $images, 'variants' => $variantsData, ]; @endphp @section('content')
{{-- Breadcrumbs --}} {{-- Main Product Grid --}}
{{-- Gallery --}}
@if(count($images) > 1)
@foreach($images as $idx => $img) @endforeach
@endif
{{-- Product Details & Purchase Box --}}
@if($product->category) {{ $product->category->name }} @endif • SKU:

{{ $product->name }}

Inclusive of all taxes (GST included)

@if($product->short_description)

{{ $product->short_description }}

@endif {{-- Eco Badges --}} @if(!empty($product->eco_badges))
@foreach($product->eco_badges as $badge) ✓ {{ str_replace('-', ' ', $badge) }} @endforeach
@endif {{-- Variants Selector --}} @if($product->variants->isNotEmpty())

Select Option

@endif {{-- Stock Status + Qty + Add to Cart --}}
In stock — ships within 24–48 hours Currently out of stock
{{-- Highlights --}} @if(!empty($product->highlights))

Why You’ll Love It

    @foreach($product->highlights as $h)
  • ✓ {{ $h }}
  • @endforeach
@endif {{-- Description & Specifications --}}
@if($product->description)

Craft & Details

{!! $product->description !!}
@endif @if(!empty($product->specifications) || $product->material || $product->dimensions)

Specifications

@if($product->material)
Material
{{ $product->material }}
@endif @if($product->dimensions)
Dimensions
{{ $product->dimensions }}
@endif @if($product->weight_grams)
Weight
{{ number_format($product->weight_grams) }} g
@endif @foreach(($product->specifications ?? []) as $k => $v)
{{ $k }}
{{ $v }}
@endforeach
@endif
{{-- Customer Reviews --}}

Customer Reviews

{{ number_format($product->rating_avg, 1) }} out of 5 ({{ $product->rating_count }} {{ Str::plural('review', $product->rating_count) }})
@for($star = 5; $star >= 1; $star--) @php $c = $distribution[$star] ?? 0; $pct = $product->rating_count ? round($c / $product->rating_count * 100) : 0; @endphp
{{ $star }} ★
{{ $c }}
@endfor
{{-- Write Review Form --}} @auth
@csrf

{{ $myReview ? 'Update your review' : 'Write a review' }}

@if($hasPurchased)

✓ Verified Buyer — publishes immediately

@endif
@else

Bought this bamboo piece?

Sign in to share your review with other shoppers.

Sign in to review
@endauth
@forelse($reviews as $rev)
{{ str_repeat('★', $rev->rating) }}{{ str_repeat('☆', 5 - $rev->rating) }} @if($rev->is_verified_purchase) Verified Buyer @endif
{{ $rev->created_at->format('d M Y') }}
@if($rev->title)

{{ $rev->title }}

@endif

{{ $rev->body }}

— {{ $rev->user?->name ?? 'Customer' }}

@empty
No reviews yet. Be the first to review {{ $product->name }}!
@endforelse {{ $reviews->links() }}
{{-- Related Products --}} @if($related->isNotEmpty())

You May Also Like

@foreach($related->take(4) as $item) @endforeach
@endif {{-- Recently Viewed --}} @if($recentlyViewed->isNotEmpty())

Recently Viewed

@foreach($recentlyViewed->take(4) as $item) @endforeach
@endif
@endsection