@extends('layouts.app') @section('content') {{-- Success Message --}} @if(session('success'))
{{ session('success') }}
@endif @php $hasDiscount = $product->sale_price && $product->sale_price < $product->price; $discountPct = $hasDiscount ? round(($product->price - $product->sale_price) / $product->price * 100) : 0; $savings = $hasDiscount ? $product->price - $product->sale_price : 0; @endphp
{{-- Breadcrumb --}} {{-- Main Card --}}
{{-- Top action bar --}}
{{-- Main Grid --}}
{{-- Left: Image Gallery --}}
{{-- Main Image --}}
@if($hasDiscount) -{{ $discountPct }}% @endif @if($product->image) {{ $product->name }} @else
ছবি পাওয়া যায়নি
@endif
{{-- Thumbnails --}}
@if($product->image)
@endif @foreach($product->images as $img)
@endforeach
{{-- Right: Product Details --}}
{{-- Title --}}

{{ $product->name }}

{{-- Rating --}} @if(isset($product->average_rating) && $product->average_rating > 0)
@for($i = 1; $i <= 5; $i++) @endfor
{{ number_format($product->average_rating, 1) }} @if(isset($product->reviews_count)) ({{ $product->reviews_count }} টি রিভিউ) @endif
@endif {{-- Price --}}
৳{{ number_format($product->sale_price ?? $product->price) }} @if($hasDiscount) ৳{{ number_format($product->price) }} @endif
@if($hasDiscount)

আপনি সাশ্রয় করছেন ৳{{ number_format($savings) }}

@endif
{{-- Action Buttons --}}
{{-- Tags / Badges --}}
@if($product->brand) {{ $product->brand }} @endif @if($product->category) {{ $product->category->name }} @endif @if($product->tags ?? false) @foreach($product->tags as $tag) {{ $tag }} @endforeach @endif
{{-- Promo strip --}} @if($product->promo_text ?? false)
{{ $product->promo_text }}
@endif {{-- Highlights --}} @if($product->highlights ?? false)

বৈশিষ্ট্য

    @foreach($product->highlights as $key => $value)
  • {{ $key }}: {{ $value }}
  • @endforeach
@endif {{-- WhatsApp Contact (Seller section style) --}}
{{-- Specification Section --}}

Specification

Title
{{ $product->name }}
@if($product->brand)
Brand
{{ $product->brand }}
@endif @if($product->highlights ?? false) @foreach($product->highlights as $key => $value)
{{ $key }}
{{ $value }}
@endforeach @endif
{{-- Description --}} @if($product->description)

পণ্যের বিবরণ

{{ $product->description }}

@endif
{{-- Customer Reviews Section --}}

Customer Reviews

{{-- Average Rating Summary --}} @if($product->reviews_count > 0)
{{ number_format($product->average_rating, 1) }}
@for($i = 1; $i <= 5; $i++) @endfor

{{ $product->reviews_count }} reviews

@endif {{-- Existing Reviews --}} @if($reviews->count() > 0)
@foreach($reviews as $review) @php $colors = ['from-purple-500 via-orange-400 to-pink-500', 'from-blue-500 via-teal-400 to-green-500', 'from-pink-500 via-red-400 to-yellow-500', 'from-cyan-500 via-blue-400 to-indigo-500', 'from-orange-500 via-yellow-400 to-red-500']; $gradient = $colors[$loop->index % count($colors)]; $initial = strtoupper(substr($review->customer_name, 0, 1)); $userPhoto = $review->user ? ($review->user->google_avatar ?? $review->user->image ?? null) : null; @endphp
@if($userPhoto) @else
{{ $initial }}
@endif

“{{ $review->review ?: 'No comment provided.' }}”

{{ $review->customer_name }}

@for($i = 1; $i <= 5; $i++) @endfor

{{ $review->created_at->diffForHumans() }}

Verified Buyer

@endforeach
@if($reviews->hasPages())
{{ $reviews->links() }}
@endif @else

No reviews yet. Be the first to review!

@endif {{-- Review Form --}}

Write a Review

@auth @if($canReview)
@csrf
{{-- Star Rating --}}
@for($i = 1; $i <= 5; $i++) @endfor Select rating
@error('rating')

{{ $message }}

@enderror
{{-- Name --}}
@error('customer_name')

{{ $message }}

@enderror
{{-- Review --}}
@else

You haven't purchased this product yet.

Only verified buyers can submit reviews.

@endif @else

Please log in to submit a review.

Log In
@endauth
{{-- Related Products ("You might also like" style) --}} @if($relatedProducts->count())

You might also like

@foreach($relatedProducts as $related) @php $rHasDiscount = $related->sale_price && $related->sale_price < $related->price; $rPct = $rHasDiscount ? round(($related->price - $related->sale_price) / $related->price * 100) : 0; @endphp @if($rHasDiscount) -{{ $rPct }}% @endif

{{ $related->name }}

@if($related->brand ?? false)

{{ $related->brand }}

@endif
@if($rHasDiscount) ৳{{ number_format($related->price) }} @endif ৳{{ number_format($related->sale_price ?? $related->price) }}
@endforeach
@endif
@endsection