@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
@if($items->count() > 0) @if ($checkType != 'list') @foreach ($items as $item)
@if ($item->is_stock())
{{ $item->is_type != 'undefine' ? (str_replace('_',' ',__("$item->is_type"))) : '' }}
@else
{{__('out of stock')}}
@endif @if($item->previous_price && $item->previous_price !=0)
-{{PriceHelper::DiscountPercentage($item)}}
@endif
Product
@include('includes.item_footer',['sitem' => $item])

{{ Str::limit($item->name, 38) }}

{!!renderStarRating($item->reviews->avg('rating'))!!}

@if ($item->previous_price !=0) {{PriceHelper::setPreviousPrice($item->previous_price)}} @endif {{PriceHelper::grandCurrencyPrice($item)}}

@endforeach @else @foreach ($items as $item)
@if ($item->is_stock())
{{ $item->is_type != 'undefine' ? ucfirst(str_replace('_',' ',$item->is_type)) : '' }}
@else
{{__('out of stock')}}
@endif @if($item->previous_price && $item->previous_price !=0)
-{{PriceHelper::DiscountPercentage($item)}}
@endif Product
@include('includes.item_footer',['sitem' => $item])

{{ Str::limit($item->name, 52) }}

{!! renderStarRating($item->reviews->avg('rating')) !!}

@if ($item->previous_price !=0) {{PriceHelper::setPreviousPrice($item->previous_price)}} @endif {{PriceHelper::grandCurrencyPrice($item)}}

{{ Str::limit(strip_tags($item->sort_details), 100) }}

@endforeach @endif @else

{{ __('No Product Found') }}

@endif
{{$items->links()}}