@extends('master.front') @section('title') {{__('Campaign Product')}} @endsection @section('meta') @endsection @section('content')
@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

{{ $setting->campaign_title }}

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

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

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

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

@endforeach
@endsection