@extends('layouts.app')
@section('title', $product->name . ' | ' . ($product->category?->name ?? 'Networking Equipment') . ' Supplier Nairobi — ECA Networks')
@section('meta_description',
$product->short_description
? Str::limit(strip_tags($product->short_description), 155) . ' Available in Nairobi, Kenya. Call ECA Networks: +254 720 309 309.'
: 'Buy ' . $product->name . ' in Nairobi Kenya from ECA Networks. Leading ' . ($product->category?->name ?? 'networking equipment') . ' supplier. Request a quote: +254 720 309 309.'
)
@section('meta_keywords', $product->name . ', ' . ($product->category?->name ?? '') . ' Kenya, ' . ($product->brand?->name ?? '') . ' Kenya, networking equipment Nairobi, ECA Networks')
@section('og_title', $product->name . ' | ECA Networks Nairobi')
@section('og_description', 'Buy ' . $product->name . ' in Nairobi from ECA Networks — Kenya\'s trusted networking equipment supplier. Call +254 720 309 309.')
@section('og_title', $product->name . ' | ECA Networks Kenya')
@section('og_description',
$product->short_description
? Str::limit(strip_tags($product->short_description), 200)
: Str::limit(strip_tags($product->description), 200)
)
@section('og_type', 'product')
@section('og_image',
$product->primary_image
? asset($product->primary_image)
: asset('images/og-eca-networks.jpg')
)
@section('meta_keywords',
implode(', ', array_filter([
$product->name,
optional($product->brand)->name,
optional($product->category)->name,
($product->name ?? '') . ' Kenya price',
($product->name ?? '') . ' buy Kenya',
'electronics Kenya',
]))
)
@section('canonical', url()->current())
@push('schema')
@endpush
@section('content')
@php
$activeVariants = $product->variants->where('is_active', true)->values();
$hasVariants = $activeVariants->count() > 0;
$basePrice = (float) $product->effective_price;
$baseSalePrice = $product->sale_price ? (float) $product->sale_price : null;
$baseStock = (int) $product->stock;
@endphp
@if($product->images->count() > 1)
@foreach($product->images as $img)
@endforeach
@endif
{{ $product->name }}
@for($i=0; $i<5; $i++)@endfor
(Reviews)
@php
$isQuoteOnly = ($product->price == 0 && $product->effective_price == 0 && !$hasVariants);
$waRaw = \App\Models\Setting::get('home_whatsapp', '+254712315165');
$waNum = preg_replace('/[^0-9]/', '', $waRaw);
$productUrl = route('products.show', $product->slug);
$waMsgPrice = urlencode(
'Redirected from "' . $productUrl . '"' . "\n\n" .
'Hi ECA Networks, I am interested in *' . $product->name . '*. Kindly share the price and availability.'
);
$waMsgHelp = urlencode('Hi ECA Networks, I need help with: ' . $product->name);
@endphp
@if(!$isQuoteOnly)
@if($product->is_on_sale && !$hasVariants)
@php $discount = round((($product->price - $product->sale_price) / $product->price) * 100); @endphp
-{{ $discount }}% OFF
@endif
@endif
@if($product->short_description)
{{ $product->short_description }}
@endif
@if($hasVariants)
@foreach($activeVariants as $variant)
@endforeach
@endif
✓ In Stock
Out of Stock
@if($product->sku || $hasVariants)
|
SKU:
@endif
@if($isQuoteOnly)
{{-- Price = 0: show WhatsApp CTA instead of cart --}}
Talk to Us on WhatsApp
@else
@endif
For bulk orders, ISPs & businesses
@if($product->datasheet)
Download Datasheet / Specs
@endif
Genuine product guaranteed
24/7 customer support
Need help? Chat with Us
@if($product->specifications)
@endif
{!! nl2br(e($product->description)) !!}
@if($product->specifications)
@foreach($product->specifications as $key => $value)
| {{ $key }} |
{{ $value }} |
@endforeach
@endif
{{-- ── REVIEWS TAB ── --}}
@php
$reviews = \Illuminate\Support\Facades\DB::table('product_reviews')
->where('product_id', $product->id)
->where('is_approved', 1)
->orderByDesc('created_at')
->get();
$avgRating = $reviews->avg('rating') ?? 0;
$reviewCount = $reviews->count();
@endphp
{{-- Success / Error flash --}}
@if(session('review_success'))
{{ session('review_success') }}
@endif
@if(session('review_error'))
{{ session('review_error') }}
@endif
{{-- Summary bar --}}
@if($reviewCount > 0)
{{ number_format($avgRating, 1) }}
@for($i = 1; $i <= 5; $i++)
@endfor
{{ $reviewCount }} {{ Str::plural('review', $reviewCount) }}
@for($star = 5; $star >= 1; $star--)
@php $cnt = $reviews->where('rating', $star)->count(); $pct = $reviewCount ? round(($cnt/$reviewCount)*100) : 0; @endphp
@endfor
{{-- Review list --}}
@foreach($reviews as $rev)
{{ strtoupper(substr($rev->reviewer_name, 0, 1)) }}
{{ $rev->reviewer_name }}
{{ \Carbon\Carbon::parse($rev->created_at)->diffForHumans() }}
@if($rev->title)
{{ $rev->title }}
@endif
@for($i = 1; $i <= 5; $i++)
@endfor
{{ $rev->review }}
@endforeach
@else
No reviews yet — be the first!
@endif
{{-- Write a Review form --}}
@if($relatedProducts->count())
@foreach($relatedProducts as $relatedProduct)
@include('components.product-card', ['product' => $relatedProduct])
@endforeach
@endif
@endsection
@push('scripts')
@endpush