@extends('front.layout.app') @section('title', 'Product Detail') @section('content') @if($product->getMedia('gallery_images')->isNotEmpty()) @foreach ($product->getMedia('gallery_images') as $image) @endforeach @endif {{$product->name}} @for ($i = 5; $i >= 1; $i--) @php $fullStars = floor($averageRating); $hasHalfStar = $averageRating - $fullStars >= 0.5; @endphp @if ($i <= $fullStars) @elseif ($i == $fullStars + 1 && $hasHalfStar) @else @endif @endfor ({{ $reviewCount }} reviews) Price:${{$product->price}} {{ preg_replace('/\s+/', ' ', str_replace('\n', ' ', strip_tags($product->description))) }} Status: @if($product->stock > 0) In Stock @else Out of Stock @endif {{-- Glass Cans :16 oz iridescent (blue, pink, purple,red) --}} Quantity - + @csrf Sorry, you cannot add more than the available stock. Add To Cart 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 @endforelse Write a Review Write a Review × Rating (1-5) Comment Submit Review @endsection @section('scripts') @endsection
{{ preg_replace('/\s+/', ' ', str_replace('\n', ' ', strip_tags($product->description))) }}
Sorry, you cannot add more than the available stock.
{{ $review->comment }}