@extends('front.layout') @section('meta-keywords', "$seo->meta_keywords") @section('meta-description', "$seo->meta_description") @php $reviews = App\Models\ProductReview::where('product_id', $product->id)->get(); $avarage_rating = App\Models\ProductReview::where('product_id',$product->id)->avg('review'); $avarage_rating = round($avarage_rating,2); if(Auth::user()){ $userID = Auth::user()->id; }else{ $userID = null; } $userOrders = App\Models\Order::where('user_id', $userID)->get(); $isBuyProduct = ''; foreach ($userOrders as $key => $userOrder) { $cart = json_decode($userOrder->cart,true); foreach ($cart as $key => $item){ if($item['id'] == $product->id){ $isBuyProduct = true; } } } @endphp @section('content')

{{ __('Product Details') }}

{{ $product->title }}

{{ Helper::showCurrencyPrice($product->current_price) }} {{ Helper::showCurrencyPrice($product->previous_price) }}

    @if ($product->stock > 0) @if ($product->is_downloadable != 1)
  • {{ __('Stock') }}: {{ __('In Stock') }}
  • @endif @else
  • {{ __('Stock') }}: {{ __('Out of Stock') }}
  • @endif
  • {{ __('Category') }} : {{ $product->category->name }}
  • {{ __('SKU') }} : {{ $product->sku }}

{{ $product->short_description }}

@if ($product->is_downloadable != 1)
@endif
{{ __('Add to Cart') }}
@if($visibility->is_shop_share_links == 1 ) @endif
{!! $product->description !!}
@if ($product->attributes_title && $product->attributes_description)
@if ($product->attributes_title && $product->attributes_description) @foreach (explode(',,,', $product->attributes_title) as $attr_key => $attr_title) @php $attr_desc = explode(',,,', $product->attributes_description)[$attr_key]; @endphp @endforeach @endif
{{ $attr_title }} {{ $attr_desc }}
@endif
@if (count($reviews) > 0) @foreach ($reviews as $review)
{{ $review->user->name }}

{{ $review->created_at->diffForHumans() }}

{{ $review->comment }}

@endforeach @else
{{__('No Rating Available')}}
@endif
@if (Auth::user()) @if ($isBuyProduct == true)

{{ __('Add a Review') }}

{{ __('Your Rating:') }}
@csrf
@endif @else @endif
@endsection @section('script') @endsection