@extends('layouts.public') @section('title', 'Browse Products | UsedStore.ca') @section('meta_description', 'Browse products and services on UsedStore.ca') @section('canonical', route('shop')) @section('og_title', 'Browse Products | UsedStore.ca') @section('og_description', 'Browse products and services on UsedStore.ca') @section('og_image', asset('logo.png')) @section('content') @php $lang = session('locale', 'en'); $translations = [ 'en' => [ 'page_title' => 'Browse Products & Services | Used Store', 'meta_description' => 'Browse used clothing, accessories and local clothing services.', 'home' => 'Home', 'categories' => 'Categories', 'products' => 'Products', 'why_us' => 'Why Us', 'contact' => 'Contact', 'login' => 'Login', 'dashboard' => 'Dashboard', 'start_selling' => 'Start Selling', 'menu' => 'Menu', 'eyebrow' => 'MARKETPLACE', 'title' => 'Discover Products & Services', 'subtitle' => 'Browse real listings from sellers and service providers across Canada.', 'search_placeholder' => 'Search products, brands or services...', 'search' => 'Search', 'all_categories' => 'All Categories', 'sort_by' => 'Sort by', 'newest' => 'Newest', 'price_low' => 'Price: Low to High', 'price_high' => 'Price: High to Low', 'oldest' => 'Oldest', 'filters' => 'Filters', 'clear_filters' => 'Clear Filters', 'all' => 'All', 'men' => 'Men', 'women' => 'Women', 'kids' => 'Kids', 'shoes' => 'Shoes', 'bags' => 'Bags', 'accessories' => 'Accessories', 'services' => 'Services', 'results' => 'results', 'showing_for' => 'Showing listings for', 'all_listings' => 'All listings', 'available' => 'Available', 'sold' => 'Sold', 'size' => 'Size', 'location' => 'Location', 'view_listing' => 'View Listing', 'service' => 'Service', 'brand' => 'Brand', 'condition' => 'Condition', 'shoe_size' => 'Shoe Size', 'service_type' => 'Service Type', 'duration' => 'Duration', 'no_image' => 'No Image', 'no_results' => 'No listings found', 'no_results_text' => 'Try changing your filters or search terms.', 'back_home' => 'Back to Home', 'previous' => 'Previous', 'next' => 'Next', 'footer_description' => 'Modern second-hand marketplace for clothing and services.', 'rights' => 'All rights reserved.', ], 'fr' => [ 'page_title' => 'Produits et services | Used Store', 'meta_description' => 'Découvrez des vêtements usagés, des accessoires et des services locaux.', 'home' => 'Accueil', 'categories' => 'Catégories', 'products' => 'Produits', 'why_us' => 'Pourquoi nous', 'contact' => 'Contact', 'login' => 'Connexion', 'dashboard' => 'Tableau de bord', 'start_selling' => 'Commencer à vendre', 'menu' => 'Menu', 'eyebrow' => 'MARCHÉ', 'title' => 'Découvrez les produits et services', 'subtitle' => 'Consultez de vraies annonces de vendeurs et de fournisseurs de services partout au Canada.', 'search_placeholder' => 'Rechercher un produit, une marque ou un service...', 'search' => 'Rechercher', 'all_categories' => 'Toutes les catégories', 'sort_by' => 'Trier par', 'newest' => 'Plus récent', 'price_low' => 'Prix : croissant', 'price_high' => 'Prix : décroissant', 'oldest' => 'Plus ancien', 'filters' => 'Filtres', 'clear_filters' => 'Effacer les filtres', 'all' => 'Tout', 'men' => 'Hommes', 'women' => 'Femmes', 'kids' => 'Enfants', 'shoes' => 'Chaussures', 'bags' => 'Sacs', 'accessories' => 'Accessoires', 'services' => 'Services', 'results' => 'résultats', 'showing_for' => 'Annonces pour', 'all_listings' => 'Toutes les annonces', 'available' => 'Disponible', 'sold' => 'Vendu', 'size' => 'Taille', 'location' => 'Localisation', 'view_listing' => 'Voir l’annonce', 'service' => 'Service', 'brand' => 'Brand', 'condition' => 'Condition', 'shoe_size' => 'Shoe Size', 'service_type' => 'Service Type', 'duration' => 'Duration', 'no_image' => 'Aucune image', 'no_results' => 'Aucune annonce trouvée', 'no_results_text' => 'Essayez de modifier vos filtres ou votre recherche.', 'back_home' => 'Retour à l’accueil', 'previous' => 'Précédent', 'next' => 'Suivant', 'footer_description' => 'Marché moderne de vêtements d’occasion et de services.', 'rights' => 'Tous droits réservés.', ], ]; $t = $translations[$lang] ?? $translations['en']; $categories = [ ['value' => '', 'label' => $t['all'], 'icon' => '✦'], ['value' => 'Men', 'label' => $t['men'], 'icon' => '👔'], ['value' => 'Women', 'label' => $t['women'], 'icon' => '👗'], ['value' => 'Kids', 'label' => $t['kids'], 'icon' => '🧸'], ['value' => 'Shoes', 'label' => $t['shoes'], 'icon' => '👟'], ['value' => 'Bags', 'label' => $t['bags'], 'icon' => '👜'], ['value' => 'Accessories', 'label' => $t['accessories'], 'icon' => '⌚'], ['value' => 'Services', 'label' => $t['services'], 'icon' => '✂️'], ]; $selectedCategory = request('category', $selectedCategory ?? ''); $selectedSort = request('sort', 'newest'); $searchValue = request('search', ''); @endphp {{ $t['page_title'] }} @vite(['resources/css/app.css', 'resources/js/app.js'])
{{ $t['eyebrow'] }}

{{ $t['title'] }}

{{ $t['subtitle'] }}

⌕
@foreach($categories as $category) {{ $category['icon'] }} {{ $category['label'] }} @endforeach @if($selectedCategory || $searchValue || $selectedSort !== 'newest') × {{ $t['clear_filters'] }} @endif

@if($selectedCategory) {{ $t['showing_for'] }} {{ collect($categories)->firstWhere('value', $selectedCategory)['label'] ?? $selectedCategory }} @else {{ $t['all_listings'] }} @endif

{{ $products->total() }} {{ $t['results'] }}

{{ $products->total() }} {{ $t['results'] }}
@if($products->count())
@foreach($products as $product) @php $images = is_array($product->images) ? $product->images : json_decode($product->images ?? '[]', true); $images = is_array($images) ? $images : []; $firstImage = $images[0] ?? null; // Support both uploaded local images and external image URLs. // Also normalize Windows-style backslashes stored in older rows. $imageUrl = null; if ($firstImage) { $normalizedImage = str_replace('\\', '/', trim($firstImage)); if (\Illuminate\Support\Str::startsWith($normalizedImage, ['http://', 'https://', '//'])) { $imageUrl = $normalizedImage; } else { $imageUrl = asset('storage/' . ltrim($normalizedImage, '/')); } } $price = $product->discount_price ?: $product->price; $isSold = strtolower($product->status ?? 'available') === 'sold'; $isService = $product->category === 'Services'; @endphp
@if($imageUrl) {{ $product->title }} @else
{{ $t['no_image'] }}
@endif {{ collect($categories)->firstWhere('value', $product->category)['label'] ?? $product->category }} {{ $isSold ? $t['sold'] : $t['available'] }} @if($isService) ✂ {{ $t['service'] }} @endif

{{ $product->title }}

@if($isService) {{ $t['service_type'] }}: {{ $product->brand ?: '-' }} @if($product->size) • {{ $t['duration'] }}: {{ $product->size }} @endif @elseif($product->category === 'Shoes') {{ $t['shoe_size'] }}: {{ $product->size ?: '-' }} @if($product->brand) • {{ $product->brand }} @endif @else {{ $t['size'] }}: {{ $product->size ?: '-' }} @if($product->brand) • {{ $product->brand }} @endif @endif
@if(!$isService && $product->condition)
{{ $t['condition'] }}: {{ $product->condition }}
@endif
${{ number_format($price, 2) }} @if($product->discount_price) ${{ number_format($product->price, 2) }} @endif
@if($product->location)
⌖ {{ $product->location }}
@endif {{ $t['view_listing'] }} →
@endforeach
{{ $products->links() }}
@else
⌕

{{ $t['no_results'] }}

{{ $t['no_results_text'] }}

@endif
@endsection