@extends('layouts.public.app') @php $images = @$product->getimages ? @$product->getimages ->whereNull('deleted_at') ->whereIn('section', ['mainimage', 'gallery','packageimage']) ->groupby('section') : ''; @endphp @section('title', @$product['name'] . ' | Chemical Wholesale') @section('description'){{ isset($product['description']) && strlen($product['description']) > 20 ? Str::limit(strip_tags($product['description']), 160) : 'Buy high-quality ' . ($product['name'] ?? 'chemicals') . ' from trusted suppliers on ChemicalWholesale. Fast shipping and competitive prices.' }}@endsection @section('keywords'){{ isset($product['name']) ? $product['name'] . ', buy ' . $product['name'] . ', wholesale ' . $product['name'] . ', bulk ' . $product['name'] . ', ' . $product['name'] . ' supplier, ' . $product['name'] . ' manufacturer' : 'Chemical Wholesale, bulk chemicals, chemical suppliers, buy chemicals online, industrial chemicals' }}@endsection @section('metaimage', !empty($images['mainimage']) ? @$images['mainimage']->first()->path : asset('img/logo-lg2.png')) @section('content')
@if (@$images['gallery'] || @$images['packageimage'] ) @endif

{{ @$product['name'] }}

@auth Ask Questions @endauth @guest Ask Questions @endguest

Product Code: {{ @$product['product_sku'] }} | @if (count($product['assignedCategory']) > 0) Category: @foreach ($product['assignedCategory'] as $productCategory) {{ $productCategory['getCategory']['name'] }} @endforeach @endif

@php $productPrice = 0; if ( !empty($product) && !empty($product->getpackage) && $product->getpackage->count() ) { foreach ($product->getpackage as $package) { $productPrice = number_format(@$package->price, 2); break; } } @endphp

${{ $productPrice }}

@if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @if ($loop->first) {{ ucfirst(string: @$package->packaging_type) == 'Other' ? ucfirst(@$package->other_packaging_type) : ucfirst(@$package->packaging_type) }} @endif @endforeach @endif
    @if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package)
  • {{ @$package['net_weight'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['net_weight'])) {{ @$package['measurement_units'] == 'metric' ? 'kg' : 'lb' }} @endif {{ ucfirst(@$package->packaging_type) == 'Other' ? ucfirst(@$package->other_packaging_type) : ucfirst(@$package->packaging_type) }}
    ${{ number_format(@$package->price, 2) }}
  • @endforeach @endif

{{ @$product['sort_description'] }} Know More
{{--
Packaging: @if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @if ($loop->first) {{ ucfirst(@$package->packaging_type) }} @endif @endforeach @endif
MOQ: 1
--}}
@if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @endforeach @endif
Sale Option Weight Price
{{ ucfirst(@$package->packaging_type) == 'Other' ? ucfirst(@$package->other_packaging_type) : ucfirst(@$package->packaging_type) }} {{ @$package['net_weight'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['net_weight'])) {{ @$package['measurement_units'] == 'metric' ? 'kg' : 'lb' }} @endif ${{ number_format(@$package->price, 2) }}
@csrf
@if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package) @if ($loop->first) @endif @endforeach @endif
@auth @endauth @guest Buy Now @endguest

{{ @$product['description'] }}

@if (!empty($product) && @$product->getoptions->count()) @foreach ($product->getoptions as $options) @endforeach @endif
Attribute name Value Description
{{ @$options['attribute_name'] }} {{ @$options['attribute_value'] }} {{ @$options['attribute_description'] }}
@if (!empty($product) && @$product->getpackage->count()) @foreach ($product->getpackage as $package)
Packaging Type {{ ucfirst(string: @$package->packaging_type) == 'Other' ? ucfirst(@$package->other_packaging_type) : ucfirst(@$package->packaging_type) }}
Packaging Description {{ ucfirst(@$package->description) }}
Net Weight {{ @$package['net_weight'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['net_weight'])) {{ @$package['measurement_units'] == 'metric' ? 'kg' : 'lb' }} @endif
Shipping Weight {{ @$package['shipping_weight'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['shipping_weight'])) {{ @$package['measurement_units'] == 'metric' ? 'kg' : 'lb' }} @endif
Shipping Length x Width x Height {{ @$package['shipping_length'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['shipping_length'])) {{ @$package['measurement_units'] == 'metric' ? 'cm' : 'in' }} @endif x {{ @$package['shipping_width'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['shipping_width'])) {{ @$package['measurement_units'] == 'metric' ? 'cm' : 'in' }} @endif x {{ @$package['shipping_height'] ?: 'N.A' }} @if (isset($package['measurement_units']) && $package['measurement_units'] && is_numeric(@$package['shipping_height'])) {{ @$package['measurement_units'] == 'metric' ? 'cm' : 'in' }} @endif
@endforeach @endif
Measurement Units ucfirst(@$product['getPackage']['measurement_units'])
@foreach (@$product->getPackage as $package)
Regulated for transportation? {{ @$package->getpackageshipping->regulated_transportation == '1' ? 'Yes' : 'No' }}
Ship the product individually? {{ @$package->getpackageshipping->ship_product == '1' ? 'Yes' : 'No' }}
Required hazard label {{ ucfirst(@$package->getpackageshipping->hazard_label) ?: 'N.A' }}
Free Shipping {{ @$package->getpackageshipping->free_shipping == '1' ? 'Yes' : 'No' }}
Fixed shipping price ${{ number_format(@$package->getpackageshipping->shipping_price, 2) ?: 'N.A' }}
@endforeach
Supplier Information
suppliers

{{ @$product['getBusiness']['company'] ?: 'Chemical Store' }}

@if (@$product->getbusiness->verified == '1') verified @endif
@php $supplierRatingCount = @$product->getbusiness->getSupplierRating->count(); $saverageRating = @$product->getbusiness->getSupplierRating->avg('rating'); $sfilledStars = (int) $saverageRating; $shalfStar = $saverageRating - $sfilledStars >= 0.5; @endphp @php $product_location = @$product->getavailability->getwarehouse->getcountry->name_en ?: @$product->getavailability->getcountry->name_en; @endphp

Location: {{ $product_location ?: '' }} | Rating: @for ($i = 1; $i <= 5; $i++) @if ($i <= $sfilledStars) @elseif ($i == $sfilledStars + 1 && $shalfStar) @else @endif @endfor ({{ @$supplierRatingCount ?: '0' }})

Supplier Information
{{--
Response Time

Less Than

1 Hr
Report Seller

Have an Issue?

Report Now
--}}
Rating and Reviews
Rate Product
@php $averageRating = @$reviews->avg('rating'); $filledStars = (int) $averageRating; $halfStar = $averageRating - $filledStars >= 0.5; @endphp
Total Reviews
{{ count(@$reviews) }} @if ($averageRating >= 4) Excellent @elseif ($averageRating >= 2) Good @else Satisfied @endif
Total review(s)
Average Rating
{{ number_format(@$reviews->avg('rating'), 1) }} @for ($i = 1; $i <= 5; $i++) @if ($i <= $filledStars) @elseif ($i == $filledStars + 1 && $halfStar) @else @endif @endfor
Total rating(s)
@php $totalReviews = $reviews->count(); $ratingsCount = [ 5 => $reviews->where('rating', 5)->count(), 4 => $reviews->where('rating', 4)->count(), 3 => $reviews->where('rating', 3)->count(), 2 => $reviews->where('rating', 2)->count(), 1 => $reviews->where('rating', 1)->count(), ]; $ratingPercentages = []; foreach ($ratingsCount as $rating => $count) { $ratingPercentages[$rating] = $totalReviews > 0 ? ($count / $totalReviews) * 100 : 0; } @endphp
@foreach ([5, 4, 3, 2, 1] as $rating)
{{ $rating }}
{{ number_format($ratingPercentages[$rating], 0) }}%
@endforeach
@if (count($related_products) > 0)
Related Products
@foreach ($related_products as $rp) @php $images = @$rp->getimages ? @$rp->getimages->groupby('section') : ''; $averageRating = @$rp->getreviews->avg('rating'); $filledStars = (int) $averageRating; $halfStar = $averageRating - $filledStars >= 0.5; @endphp
{{--
4.0
--}} product image

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

{{ @$rp['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

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

@php $rpsupplierRatingCount = @$rp->getbusiness->getSupplierRating->count(); $rpsupplieraverageRating = @$rp->getbusiness->getSupplierRating->avg( 'rating', ); @endphp

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

View Details
@endforeach
@endif @if (count($supplier_products) > 0)
More From this Supplier
@foreach ($supplier_products as $sp) @php $images = @$sp->getimages ? @$sp->getimages->groupby('section') : ''; $averageRating = @$sp->getreviews->avg('rating'); $filledStars = (int) $averageRating; $halfStar = $averageRating - $filledStars >= 0.5; @endphp
{{--
4.0
--}} product image

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

{{ @$sp['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

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

@php $spsupplierRatingCount = @$sp->getbusiness->getSupplierRating->count(); $spsupplieraverageRating = @$sp->getbusiness->getSupplierRating->avg( 'rating', ); @endphp

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

View Details
@endforeach
@endif
@endsection @push('css') @endpush @push('js') @auth @include('public.chat') @endauth @endpush