@extends('layouts.front-layout') @section('title') Product Detail @endsection @section('content')

Product
Details

@forelse($get_product_sliders as $product)
@empty

Product Image Not Found

@endforelse
@forelse($product_gallery_images as $index => $image)
@empty

Product Gallery Image Not Found

@endforelse

{{$single_product->product_name ? : ''}}

@php $ratenum =number_format($rating_value) @endphp @if($ratings->count() > 0)
Customer Reviews:({{$ratings->count()}})
@else No Rating @endif
@for ($j =$ratenum+1; $j<=5; $j++) @endfor @for($i =1; $i<=$ratenum; $i++) @endfor
  • Price:${{number_format($single_product->price ) ? : ''}}

{!! $single_product->description ? : '' !!}

  • Status:{{$single_product->stock === 0 ? 'Out Of Stock' : 'In Stock ' . $single_product->stock}}

Quantity

  • - +
@if(Auth::check()) @if(Auth::user()->hasRole('vendor') || Auth::user()->hasRole('admin')) {{-- If the user is a vendor or admin, do not show the "Add to Cart" button --}} @else @if($single_product->stock > 0) @endif @endif @else @if($single_product->stock > 0) @endif @endif

Product Reviews

@forelse($all_user_rating as $user_rating) @php $rating = App\Models\Rating::where('product_id',$single_product->id)->where('user_id',$user_rating->user_id)->first(); @endphp

{{$user_rating->user->name ? : ''}}

{{$user_rating->created_at->format('d-m-Y') ? : ''}}
@if ($rating) @php $user_rated = $rating->star_rated @endphp @for ($j =$user_rated+1; $j<=5; $j++) @endfor @for($i =1; $i<=$user_rated; $i++) @endfor @endif

{{$user_rating->review ? : ''}}


@empty
User Rating Not Found
@endforelse @auth @if(Auth::user()->hasRole('user'))

Comment

@csrf @php $rating = App\Models\Rating::where('product_id',$single_product->id)->where('user_id',Auth::user()->id)->first(); @endphp
@if ($rating) @php $user_rated = $rating->star_rated @endphp @for ($j = 5; $j > $user_rated; $j--) @endfor @for ($i = $user_rated; $i >= 1; $i--) @endfor @else @endif
@if (!$rating) @endif
@endif @endauth
@endsection @section('script') @endsection