@php $link = route('glover-website.product', [ 'id' => $product->id, 'slug' => !empty($product->name) ? \Str::slug($product->name) : \Str::random(10), ]); @endphp
Product logo {{-- discount tag --}} @if ($product->discount_price > 0)

@php $discountedPercentage = 0; try { $discountedPercentage = round( (($product->price - $product->discount_price) / $product->price) * 100, ); } catch (\Execption $error) { logger('Execption', [$error]); } @endphp ~ {{-- calculate the discount percentage between price and discount_price --}} {{ $discountedPercentage }}% {{ __('Off') }}

@endif

{{ $product->name }}

{{-- strip description of html tags --}} {{ strip_tags($product->description) }}

{{ $product->capacity ?? 0 }} {{ $product->unit }}

{{-- price --}}

@if ($product->discount_price <= 0) {{ currencyFormat($product->price) }} @endif {{ currencyFormat($product->sell_price) }}

{{-- rating --}} @if (!$product->reviews->isEmpty())
@php $maxRating = 5; $currentRating = $product->rating ?? 0; @endphp {{-- rating --}}
@for ($i = 1; $i <= $maxRating; $i++) @endfor
@else

{{ __('No Reviews yet') }}

@endif