@extends('store.layouts.app') @section('title', $product->name) @section('meta_description', Str::limit($product->short_description ?? $product->description ?? $product->name, 160)) @section('content')
{{-- Gallery --}}
@php $images = $product->images->sortBy('sort_order'); $primary = $images->firstWhere('is_primary', true) ?? $images->first(); @endphp
{{ $product->name }} @if($images->count() > 1) @endif
@if($images->count() > 1)
@foreach($images as $img) @if($img->image_path) @php $thumbUrl = \App\Helpers\ImageHelper::urlOrPlaceholder($img->image_path, 'https://images.unsplash.com/photo-1542838132-92c53300491e?w=100'); @endphp @endif @endforeach
@endif
{{-- Info --}}

{{ $product->name }}

@if($product->average_rating > 0 || ($product->ratings_count ?? 0) > 0)
@for($i = 1; $i <= 5; $i++) @endfor
{{ number_format($product->average_rating ?? 0, 1) }} ({{ $product->ratings_count ?? 0 }} reviews) View all reviews
@endif
{{ $currency_symbol }}{{ number_format($product->min_price ?? $product->base_price, 0) }} @if(($product->base_price ?? 0) > ($product->min_price ?? $product->base_price)) {{ $currency_symbol }}{{ number_format($product->base_price, 0) }} @php $discountPct = round((($product->base_price - ($product->min_price ?? $product->base_price)) / $product->base_price) * 100); @endphp {{ $discountPct }}% OFF @endif
{{-- Delivery & Trust Info --}}
Delivery in 10 minutes
In Stock
@if($product->short_description)

About this product

{{ $product->short_description }}

@endif {{-- Add to Cart Form --}}
@csrf @if($product->variants->isNotEmpty())
@foreach($product->variants as $v) @endforeach
@endif
{{-- Trust Badges --}}
100% Fresh
Quality Assured
Easy Returns
24/7 Support
{{-- Description & Nutrition --}} @if($product->description)

Product Details

{!! nl2br(e($product->description)) !!}
@endif {{-- Reviews --}}

Customer Reviews

@if($product->average_rating > 0 || ($product->ratings_count ?? 0) > 0)
{{ number_format($product->average_rating ?? 0, 1) }} ยท {{ $product->ratings_count ?? 0 }} reviews
@endif
@if($product->productRatings && $product->productRatings->isNotEmpty())
@foreach($product->productRatings as $review)
{{ $review->order && $review->order->user ? ($review->order->user->name ?: $review->order->user->email) : 'Customer' }}
@for($i = 1; $i <= 5; $i++) @endfor
@if($review->created_at) {{ $review->created_at->format('M j, Y') }} @endif
@if($review->review_text)

{{ $review->review_text }}

@endif
@endforeach
@else

No reviews yet. Be the first to review this product!

@endif
{{-- Related --}} @if($related->isNotEmpty())

Similar Products

@foreach($related as $p) @include('store.components.product-card', ['product' => $p]) @endforeach
@endif
{{-- Sticky Add to Cart Bar (Mobile) --}}

{{ $currency_symbol }}{{ number_format($product->min_price ?? $product->base_price, 0) }}

@if(($product->base_price ?? 0) > ($product->min_price ?? $product->base_price))

{{ $currency_symbol }}{{ number_format($product->base_price, 0) }}

@endif
@csrf @if($product->variants->isNotEmpty()) @endif
@push('scripts') @endpush @endsection