@extends('layouts.public') @section('title', 'Produk Lanyard Custom Tangerang') @section('meta_description', 'Temukan model lanyard berdasarkan nama, SKU, spesifikasi, atau kebutuhan aksesoris. Pilihan lengkap lanyard custom premium di Tangerang dengan harga terjangkau.') @section('seo_og_image', '/uploads/hero-lanyard-slider-01.webp') @php $produkHasSearch = !empty(request('q')) || (int)request('page', 1) > 1; @endphp @if($produkHasSearch) @section('seo_noindex', '1') @endif @section('content') @php use App\Models\Product; $search = request('q'); $page = max(1, (int) request('page', 1)); $perPage = 6; $query = Product::with('category')->where('published', true); if ($search) { $query->where(function ($q) use ($search) { $q->where('name', 'like', "%{$search}%") ->orWhere('sku', 'like', "%{$search}%") ->orWhere('shortDescription', 'like', "%{$search}%") ->orWhere('specs', 'like', "%{$search}%"); }); } $query->orderBy('sortOrder')->orderBy('createdAt', 'desc'); $total = $query->count(); $products = $query->skip(($page - 1) * $perPage)->take($perPage)->get(); $hasMore = ($page * $perPage) < $total; $nextPage = $hasMore ? $page + 1 : null; // Fallback dummy products if empty if ($products->isEmpty() && !$search) { $products = collect([ (object) ['name' => 'Lanyard Tissue Premium', 'slug' => 'lanyard-tissue', 'sku' => 'LT-001', 'shortDescription' => 'Permukaan halus, warna tajam permanen.', 'featuredImage' => '/uploads/hero-lanyard-slider-01.webp', 'basePrice' => 'Mulai Rp 5.000', 'category' => (object) ['name' => 'Tissue']], (object) ['name' => 'Lanyard Polyester Standar', 'slug' => 'lanyard-polyester', 'sku' => 'LP-001', 'shortDescription' => 'Ekonomis dan tahan lama untuk event besar.', 'featuredImage' => '/uploads/hero-lanyard-slider-02.webp', 'basePrice' => 'Mulai Rp 3.500', 'category' => (object) ['name' => 'Polyester']], (object) ['name' => 'Aksesoris Hook Plastik', 'slug' => 'hook-plastik', 'sku' => 'AH-001', 'shortDescription' => 'Hook plastik berkualitas tinggi.', 'featuredImage' => '/uploads/hero-lanyard-slider-01.webp', 'basePrice' => null, 'category' => (object) ['name' => 'Aksesoris']], (object) ['name' => 'ID Card Holder Kulit', 'slug' => 'id-card-kulit', 'sku' => 'IC-001', 'shortDescription' => 'Casing ID Card kulit premium.', 'featuredImage' => '/uploads/hero-lanyard-slider-02.webp', 'basePrice' => 'Mulai Rp 15.000', 'category' => (object) ['name' => 'Holder']], (object) ['name' => 'Lanyard Sablon Full Color', 'slug' => 'lanyard-sablon', 'sku' => 'LS-001', 'shortDescription' => 'Cetak sablon full color untuk desain kompleks.', 'featuredImage' => '/uploads/hero-lanyard-slider-01.webp', 'basePrice' => 'Mulai Rp 4.500', 'category' => (object) ['name' => 'Sablon']], (object) ['name' => 'Aksesoris Stopper Silikon', 'slug' => 'stopper-silikon', 'sku' => 'AS-001', 'shortDescription' => 'Stopper silikon elastis dan awet.', 'featuredImage' => '/uploads/hero-lanyard-slider-02.webp', 'basePrice' => null, 'category' => (object) ['name' => 'Aksesoris']], ]); $total = $products->count(); $hasMore = false; } // Helper: resolve image URL $img = fn ($src) => \App\Support\AssetUrl::relative($src); // Helper: strip HTML for plain text excerpt $plain = fn($v) => trim(str_replace(' ', ' ', strip_tags((string) ($v ?? '')))); @endphp {{-- Hero mini --}}

Produk

Pilihan Lanyard Custom

Temukan model lanyard berdasarkan nama, SKU, spesifikasi, atau kebutuhan aksesoris.

{{-- Search form --}}
@if ($search) Hapus @endif

@if($search) @if($total > 0) Menampilkan {{ $products->count() }} hasil untuk "{{ $search }}" @else Tidak ada produk yang cocok untuk "{{ $search }}" @endif @else {{ $total > 0 ? "Menampilkan {$products->count()} dari {$total} produk" : 'Belum ada produk tersedia' }} @endif

{{-- Product Grid --}}
@if ($products->isEmpty())
inventory_2

Produk tidak ditemukan

Coba gunakan nama, SKU, atau kata kunci yang berbeda.

@else {{-- Load More --}} @if ($hasMore) @endif @endif
{{-- CTA + Footer --}} @include('components.cta') @include('components.footer') @push('schema') @include('components.schema.produk') @endpush @endsection