@extends('layouts.admin.app') @section('title',translate('Food Preview')) @push('css_or_js') @endpush @section('content')
Image Description
{{-- {{ dd($product->restaurant) }} --}}

{{ number_format($product->avg_rating, 1)}}/5

@if ($product->avg_rating == 5)
@elseif ($product->avg_rating < 5 && $product->avg_rating >= 4.5)
@elseif ($product->avg_rating < 4.5 && $product->avg_rating >= 4)
@elseif ($product->avg_rating < 4 && $product->avg_rating >= 3.5)
@elseif ($product->avg_rating < 3.5 && $product->avg_rating >= 3)
@elseif ($product->avg_rating < 3 && $product->avg_rating >= 2.5)
@elseif ($product->avg_rating < 2.5 && $product->avg_rating > 2)
@elseif ($product->avg_rating < 2 && $product->avg_rating >= 1.5)
@elseif ($product->avg_rating < 1.5 && $product->avg_rating > 1)
@elseif ($product->avg_rating < 1 && $product->avg_rating > 0)
@elseif ($product->avg_rating == 1)
@elseif ($product->avg_rating == 0)
@endif
{{-- of {{ $product->rating ? count(json_decode($product->rating, true)): 0 }} Rating --}} {{translate('messages.of')}} {{$product->reviews->count()}} {{translate('messages.reviews')}}
    @php($total=$product->rating?array_sum(json_decode($product->rating, true)):0)
  • @php($five=$product->rating?json_decode($product->rating, true)[5]:0) {{ translate('Excellent') }}
    {{$five}}
  • @php($four=$product->rating?json_decode($product->rating, true)[4]:0) {{ translate('Good') }}
    {{$four}}
  • @php($three=$product->rating?json_decode($product->rating, true)[3]:0) {{ translate('Average') }}
    {{$three}}
  • @php($two=$product->rating?json_decode($product->rating, true)[2]:0) {{ translate('Below Average') }}
    {{$two}}
  • @php($one=$product->rating?json_decode($product->rating, true)[1]:0) {{ translate('Poor') }}
    {{$one}}
@if($product->restaurant) Image Description
{{$product->restaurant['name']}}
{{$product->restaurant['address']}}
@else
{{translate('messages.restaurant')}} {{translate('messages.deleted')}}
@endif

{{ translate('Short Description') }}

{{translate('messages.price')}}

{{translate('messages.variations')}}

{{ translate('Addons') }}

{{ translate('Tags') }}

{!!$product['description'] !!}
{{ translate('Price') }} {{\App\CentralLogics\Helpers::format_currency($product['price'])}} {{translate('messages.discount')}} : {{\App\CentralLogics\Helpers::format_currency(\App\CentralLogics\Helpers::discount_calculate($product,$product['price']))}} {{translate('messages.available')}} {{translate('messages.time')}} {{translate('messages.starts')}} : {{date(config('timeformat'),strtotime($product['available_time_starts']))}} {{translate('messages.available')}} {{translate('messages.time')}} {{translate('messages.ends')}} : {{date(config('timeformat'), strtotime($product['available_time_ends']))}} {{-- {{ dd(json_decode($product['variations'],true)) }} --}} @foreach(json_decode($product->variations,true) as $variation) @if(isset($variation["price"])) {{ translate('please_update_the_food_variations.') }} @break @else {{$variation['name']}} - @if ($variation['type'] == 'multi') {{ translate('messages.multiple_select') }} @elseif($variation['type'] =='single') {{ translate('messages.single_select') }} @endif @if ($variation['required'] == 'on') - ({{ translate('messages.required') }}) @endif @if ($variation['min'] != 0 && $variation['max'] != 0) ({{ translate('messages.Min_select') }}: {{ $variation['min'] }} - {{ translate('messages.Max_select') }}: {{ $variation['max'] }}) @endif @if (isset($variation['values'])) @foreach ($variation['values'] as $value)     {{ $value['label']}} : {{\App\CentralLogics\Helpers::format_currency( $value['optionPrice'])}} @endforeach @endif @endif @endforeach @foreach(\App\Models\AddOn::withOutGlobalScope(App\Scopes\RestaurantScope::class)->whereIn('id',json_decode($product['add_ons'],true))->get() as $addon) {{$addon['name']}} : {{\App\CentralLogics\Helpers::format_currency($addon['price'])}} @endforeach @forelse($product->tags as $c) {{$c->tag.','}} @empty {{ translate('No_tags_found') }} @endforelse
{{--
@if(isset($product->variations)) @foreach(json_decode($product->variations,true) as $variation)
{{$variation['name']}}: @if ($variation['type']=='single') {{translate('input_filed')}} @elseif($variation['type']=='multi') {{translate('textarea_filed')}} @else @endif
@endforeach @endif
--}}
{{translate('messages.product')}} {{translate('messages.reviews')}}
@foreach($reviews as $review) @endforeach
{{translate('messages.reviewer')}} {{translate('messages.review')}} {{translate('messages.date')}} {{translate('messages.status')}}
@if ($review->customer)
Image Description
{{$review->customer['f_name']." ".$review->customer['l_name']}} {{$review->customer->email}}
@else {{translate('messages.customer_not_found')}} @endif

{{$review['comment']}}

{{date('d M Y '.config('timeformat'),strtotime($review['created_at']))}}
@if(count($reviews) === 0)
public
{{translate('no_data_found')}}
@endif
{{--
1-15 of 380
--}}
{!! $reviews->links() !!}
@endsection @push('script_2') @endpush