@extends('master.front') @section('title') {{ $item->name }} @endsection @section('meta') @endsection @section('content')

{{ $item->name }}

{!! renderStarRating($item->reviews->avg('rating')) !!}
@if ($item->is_stock()) {{ __('In Stock') }} ({{ $item->stock }} @lang('items')) @else {{ __('Out of stock') }} @endif
@if ($item->is_type == 'flash_deal') @if (date('d-m-y') != \Carbon\Carbon::parse($item->date)->format('d-m-y'))
@endif @endif @if ($item->previous_price != 0) {{ PriceHelper::setPreviousPrice($item->previous_price) }} @endif {{ PriceHelper::grandCurrencyPrice($item) }}

@foreach ($attributes as $attribute) @if ($attribute->options->count() != 0)
@endif @endforeach
@if ($item->item_type == 'normal')
@endif
@if ($item->item_type != 'affiliate') @if ($item->is_stock()) @else {{-- Success flash (outside modal) --}} @if (session('preorder_success'))
{{ session('preorder_success') }}
@endif @endif @else Order Now @endif
@if ($item->brand_id)
{{ __('Brand') }}: {{ $item->brand->name }}
@endif
{{ __('Categories') }}: {{ $item->category->name }} @if ($item->subcategory->name) / @endif {{ $item->subcategory->name }} @if ($item->childcategory->name) / @endif {{ $item->childcategory->name }}
{{ __('Tags') }}: @if ($item->tags) @foreach (explode(',', $item->tags) as $tag) @if ($loop->last) {{ $tag }} @else {{ $tag }}, @endif @endforeach @endif
@if ($item->item_type == 'normal')
{{ __('SKU') }}: #{{ $item->sku }}
@endif
{!! $item->details !!}
@if ($sec_name) @foreach (array_combine($sec_name, $sec_details) as $sname => $sdetail) @endforeach @else @endif
{{ __('Specifications') }} {{ __('Descriptions') }}
{{ $sname }} {{ $sdetail }}
{{ __('No Specifications') }}
{{-- Pre Order Modal --}} {{-- Re-open modal if there were validation errors (so user can fix and resubmit) --}} @if ($errors->any()) @endif @php function renderStarRating($rating, $maxRating = 5) { $fullStar = ""; $halfStar = ""; $emptyStar = ""; $rating = $rating <= $maxRating ? $rating : $maxRating; $fullStarCount = (int) $rating; $halfStarCount = ceil($rating) - $fullStarCount; $emptyStarCount = $maxRating - $fullStarCount - $halfStarCount; $html = str_repeat($fullStar, $fullStarCount); $html .= str_repeat($halfStar, $halfStarCount); $html .= str_repeat($emptyStar, $emptyStarCount); $html = $html; return $html; } @endphp

{{ __('Latest Reviews') }}

@forelse ($reviews as $review)
Comment author

{{ $review->subject }}

{{ $review->user->first_name }} {{ $review->created_at->format('M d, Y') }}
@php for ($i = 0; $i < $review->rating; $i++) { echo ""; } @endphp

{{ $review->review }}

@empty
{{ __('No Review') }}
@endforelse
{{ $reviews->links() }}
{{ round($item->reviews->avg('rating'), 2) }}
{!! renderStarRating($item->reviews->avg('rating')) !!}
@if (Auth::user()) @else @endif
@auth @endauth @endsection