@extends('layouts.app') @section('title', $product->name . ' | Shopora') @section('content')
{{-- Breadcrumb --}}
{{-- Image Gallery --}}
@if($product->images && is_array($product->images) && count($product->images) > 0) {{ $product->name }} @else @endif
@if($product->images && is_array($product->images) && count($product->images) > 1)
@foreach($product->images as $img)
@endforeach
@endif
{{-- Product Info --}}
@if($product->is_on_sale)
Limited Offer
@endif

{{ $product->name }}

@for($i=1;$i<=5;$i++) @endfor ({{ $product->reviews_count }})
|

{{ $product->brand ?? 'Exclusive Collection' }}

Investment

Rs. {{ number_format($product->current_price) }}
@if($product->is_on_sale)
Rs. {{ number_format($product->price) }} -{{ $product->discount_percent }}% Savings
@endif

{{ Str::limit($product->description, 250) }}

@foreach(['Standard Logistics', '14 Day Exchange', 'Premium Quality', 'Secure Payment'] as $f)
{{ $f }}
@endforeach
@if($product->is_in_stock)
Pieces
@csrf
@else

Out of Space (Restocking Soon)

@endif
{{-- Details & Reviews --}}
{{-- Description --}}

Product details of {{ $product->name }}

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

Ratings & Reviews

{{ $product->rating }} /5
@for($i=1;$i<=5;$i++)@endfor

{{ $product->reviews_count }} Ratings

@auth @if(!$alreadyReviewed) @php $canReview = \App\Models\Order::where('user_id', auth()->id()) ->where('status', 'delivered') ->whereHas('items', function($q) use ($product) { $q->where('product_id', $product->id); })->exists(); @endphp @if($canReview)

Share Your Experience

@csrf

Overall Rating

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

You can only review this product after your order has been delivered.

View My Orders
@endif @endif @endauth
@forelse($product->approvedReviews as $review)
{{ $review->created_at->diffForHumans() }}
@php $hasPurchased = \App\Models\Order::where('user_id', $review->user_id) ->where('status', 'delivered') ->whereHas('items', function($q) use ($product) { $q->where('product_id', $product->id); })->exists(); @endphp

by {{ $review->user->name }}

@if($hasPurchased) Verified Purchase @endif
@if($review->title)

{{ $review->title }}

@endif @if($review->body)

{{ $review->body }}

@endif
@empty
No reviews yet.
@endforelse
{{-- Recommendations --}}

Just For You

@foreach($related->take(4) as $rel) @include('partials.product-card',['product'=>$rel]) @endforeach
@endsection