@if (!empty($products) && count($products) > 0)
@foreach ($products as $product) @php $images = @$product->getimages ? @$product->getimages->groupby('section') : ''; $averageRating = @$product->getreviews->avg('rating'); $filledStars = (int) $averageRating; $halfStar = $averageRating - $filledStars >= 0.5; @endphp
{{--
4.0
--}} product image

Category: {{ @$product['getCategory']['name'] }} | Rating: @for ($i = 1; $i <= 5; $i++) @if ($i <= $filledStars) @elseif ($i == $filledStars + 1 && $halfStar) @else @endif @endfor ({{ count(@$product->getreviews) }})

{{ @$product['name'] }}
Product SKU: {{ @$product['product_sku'] }}
Packaging: @if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @if ($loop->first) {{ ucfirst(@$package->packaging_type) }} @endif @endforeach @endif
MOQ: @if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @if ($loop->first) {{ ucfirst(@$package->min_quantity) }} @endif @endforeach @endif
Price: @if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @if ($loop->first) ${{ number_format(@$package->price, 2) }} @endif @endforeach @endif

{{ @$product->getbusiness->company ?: 'N.A' }} @if (@$product->getbusiness->verified == '1') @endif

@php $supplierRatingCount = @$product->getbusiness->getSupplierRating->count(); $supplieraverageRating = @$product->getbusiness->getSupplierRating->avg('rating'); @endphp

@php $product_location = @$product->getavailability->getwarehouse->getcountry->name_en ?: @$product->getavailability->getcountry->name_en; @endphp From {{ $product_location ? ' ' . $product_location : 'N.A' }} @if ($supplierRatingCount > 0) | Rating: {{ number_format(@$supplieraverageRating, 1) ?: '0.0' }}/5.0 ({{ @$supplierRatingCount ?: 0 }} Reviews) @endif

View Details
@endforeach
@else

... No products to show

@endif @if (ceil($pages) > 1)
@endif