@extends('layouts.public.app') @section('title', @$supplier['company'] . ' Products | Chemical Wholesale') @section('description', 'Checkout ' . @$supplier['company'] . ' Products on Chemical Wholesale') @section('keywords', @$supplier['company'] ?: 'Chemical Wholesale') @section('metaimage', @$supplier['getLogo']['path'] ? asset(@$supplier['getLogo']['path']) : asset('img/logo-lg2.png')) @section('content')
@include('public.supplier.supplier-page-header')
@if (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

@if (count($product['assignedCategory']) > 0) Category: @foreach ($product['assignedCategory'] as $productCategory) {{ $productCategory['getCategory']['name'] }} @endforeach | @endif 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 show
Search products
@endif
@endsection @push('css') @endpush @push('js') @auth @include('public.chat') @endauth @endpush