@php $productTitle = request('title', 'Noko Men\'s Chronograph Leather Watch'); $productBrand = request('brand', 'NOKO'); $productCategory = request('category', 'Fashion'); $productPrice = request('price', 'LKR 45,000'); $productOldPrice = request('old_price', 'LKR 56,250'); $productBadge = request('badge', 'SAVE 20%'); $mainImg = request('image', 'https://images.unsplash.com/photo-1523275335684-37898b6baf30?q=80&w=800&auto=format&fit=crop'); // If slug or ID parameter is provided, query database for exact product $currentSlug = request('slug', $slug ?? null); $currentId = request('id', null); $dbProd = null; if ($currentSlug) { $dbProd = \App\Models\Product::with(['primaryImage', 'images', 'category', 'brand'])->where('slug', $currentSlug)->first(); } elseif ($currentId) { $dbProd = \App\Models\Product::with(['primaryImage', 'images', 'category', 'brand'])->find($currentId); } if ($dbProd) { $productTitle = $dbProd->title; $productBrand = $dbProd->brand ? strtoupper($dbProd->brand->name) : 'NOKO'; $productCategory = $dbProd->category ? $dbProd->category->name : 'General'; $productPrice = 'LKR ' . number_format($dbProd->price); $productOldPrice = $dbProd->discount_price ? 'LKR ' . number_format($dbProd->discount_price) : ''; $productBadge = $dbProd->discount_price ? 'SAVE ' . round((($dbProd->price - $dbProd->discount_price)/$dbProd->price)*100) . '%' : ''; $galleryImages = []; if ($dbProd->images && count($dbProd->images) > 0) { foreach ($dbProd->images as $imgObj) { $galleryImages[] = asset('storage/' . $imgObj->path); } } elseif ($dbProd->primary_image) { $galleryImages[] = asset('storage/' . $dbProd->primary_image->path); } if (empty($galleryImages)) { $galleryImages = [$mainImg]; } $mainImg = $galleryImages[0]; } else { $galleryImages = [$mainImg, $mainImg, $mainImg, $mainImg]; } @endphp {{ $productTitle }} | noko.lk @include('partials.cart-drawer')
Success!
{{ $productTitle }}
{{ $productBrand }}

{{ $productTitle }}

5.0 (215 reviews) In Stock
{{ $productPrice }} @if($productOldPrice) {{ $productOldPrice }} @endif @if($productBadge) {{ $productBadge }} @endif

FREE DELIVERY
On orders over 10k
1 YEAR WARRANTY
Manufacturer guarantee
7-DAY RETURNS
Hassle-free process
Brand {{ $productBrand }}
Category {{ $productCategory }}
Authenticity 100% Original Genuine Item
Warranty 1-Year Local Manufacturer Warranty

About {{ $productTitle }}

Experience premium luxury and craftsmanship with {{ $productTitle }}. Designed for durability, style, and everyday elegance.