@extends('layouts.front-layout') @section('title') Product Details @endsection @section('content') Product Details @if(count($single_product_detail->productGalleryImages()) > 0) @forelse($single_product_detail->productGalleryImages() as $galleryImg) @empty Product Gallery Image Not Found @endforelse @endif @if(count($single_product_detail->productGalleryImages()) > 0) @forelse($single_product_detail->productGalleryImages() as $galleryImg) @empty Product Gallery Image Not Found @endforelse @endif {{$single_product_detail->product_name ? : ''}} @for ($i = 5; $i >= 1; $i--) @php $fullStars = floor($averageRating); // Full stars $hasHalfStar = $averageRating - $fullStars >= 0.5; // Check if there's a half star @endphp @if ($i <= $fullStars) @elseif ($i == $fullStars + 1 && $hasHalfStar) @else @endif @endfor ({{ $reviewCount }} reviews) @if($single_product_detail->product_price > 0) Price:${{ $single_product_detail->product_price }} @endif {!! $single_product_detail->description ? : '' !!} Status:{{$single_product_detail->stock === 0 ? 'Out Of Stock' : 'In Stock ' . $single_product_detail->stock}} Quantity - + @if(Auth::check()) @if(Auth::user()->hasRole('admin')) @else @if($single_product_detail->stock > 0 && $single_product_detail->product_status === 'Active' && $single_product_detail->product_price > 0) Add To Cart @elseif($single_product_detail->product_status === 'Future' || $single_product_detail->product_price < 0) Coming Soon @else @endif @endif @else @if($single_product_detail->stock > 0 && $single_product_detail->product_status === 'Active' && $single_product_detail->product_price > 0) Add To Cart @elseif( $single_product_detail->product_status === 'Future'|| $single_product_detail->product_price <= 0) Coming Soon @else @endif @endif Product Reviews @forelse($reviews as $review) {{ $review->user->name ?? 'Anonymous' }} {{ \Carbon\Carbon::parse($review->created_at)->format('m-d-Y') }} | {{ \Carbon\Carbon::parse($review->created_at)->format('h:i A') }} @for ($i = 1; $i <= 5; $i++) @php $fullStars = floor($review->rating); $hasHalfStar = $review->rating - $fullStars >= 0.5; @endphp @if ($i <= $fullStars) @elseif ($i == $fullStars + 1 && $hasHalfStar) @else @endif @endfor {{ $review->comment }} @empty No reviews yet. Be the first to review this product! @endforelse Write a Review Write a Review × Rating (1-5) Comment Submit Review @endsection @section('script') @endsection
{{ $review->comment }}
No reviews yet. Be the first to review this product!