@extends('layout.index') @section('content')
@foreach($products->secondary_images as $key => $image)
@endforeach

{{$products->name}}

@if(!empty($products->rating)) @php $roundedRating = round($products->rating); @endphp {!! str_repeat('', $roundedRating) !!} {!! str_repeat('',5- $roundedRating ) !!} @else @endif {{$products->rating_count}} - customer Review

{{$products->description}}

@if( $products->discounted_price != null) £{{$products->discounted_price}}.00 @else £{{$products->price}}.00 @endif @if($products->quantity >= '1') In stock @else Out Of stock @endif
    @csrf
  • Quantity ({{$products->quantity}})

  • @php $size_ids = \DB::table('product_details')->select('size_id')->where('product_id', $products->id)->get(); $sizeData = []; foreach ($size_ids as $size_id) { $size = \DB::table('sizes')->select('short_name', 'id')->where('id', $size_id->size_id)->first(); if ($size) { $sizeData[] = $size; } } @endphp
    SIZE :
@php $ratings = \DB::table('ratings') ->select('*') ->where('product_id',$products->id)->get(); @endphp
@foreach($ratings as $rating)
@if(!empty($rating->stars)) @php $roundedRating = round($rating->stars); @endphp {!! str_repeat('', $roundedRating) !!} {!! str_repeat('',5- $roundedRating ) !!} @else @endif

{{$rating->description}}

@endforeach
@endsection @section('script') @endsection