@extends('layouts.app') @section('title', $category->nom . ' - Mady Market') @push('styles') @endpush @section('content') @if($category->parent_id === null && request('view') !== 'list') @if($banner)
Durée limitée ! @if($banner->promo_discount) {{ $banner->promo_discount }} OFFERTS* @if($banner->promo_conditions) {{ $banner->promo_conditions }} @endif @if($banner->promo_code) avec le code {{ $banner->promo_code }} @endif @else {{ $banner->title }} @endif
@endif @php $bgImage = 'https://images.unsplash.com/photo-1589923188900-85dae523342b?q=80&w=2070&auto=format&fit=crop'; if ($banner) { $bgImage = $banner->image_url; } elseif ($category->image) { $bgImage = $category->image; } elseif ($category->slug === 'e-commerce') { $bgImage = 'https://images.samsung.com/is/image/samsung/assets/sn/home/2024/Galaxy_S24_Ultra_Main_KV_1440x640_pc.jpg'; } @endphp
@if($banner && $banner->link_url) @endif
@if(isset($category->enfantsActifs)) @foreach($category->enfantsActifs as $enfant) {{ $enfant->nom }} @endforeach @endif
@endif @if($category->parent_id === null && request('view') !== 'list' && isset($topConsultes) && $topConsultes->count() > 0)

Top des produits les plus consultés

@endif
@if($category->parent_id !== null || request('view') === 'list') @endif
@if($category->parent_id !== null || request('view') === 'list')
Accueil @foreach($category->ancetres as $ancetre) {{ $ancetre->nom }} @endforeach {{ $category->nom }}

{{ $category->nom }}

@endif @if($category->parent_id === null && request('view') !== 'list') @if(count($offresReductions) > 0)

Les offres qui valent le coup

@elseif($annonces->count() > 0)

Nos produits phares de nos marchands pro

@endif @if($dealsMarchands->count() > 0)

Nos deals marchands du moment

@endif @if($selectionAnnonces->count() > 0)

Notre sélection {{ $category->nom }}

@foreach($selectionAnnonces as $index => $annonce) @php $n2Id = null; $n3Id = null; $cat = $annonce->category; if ($cat) { if ($cat->parent_id == $category->id) { $n2Id = $cat->id; } elseif ($cat->parent && $cat->parent->parent_id == $category->id) { $n2Id = $cat->parent_id; $n3Id = $cat->id; } } $normEtat = 'neuf'; $rawEtat = strtolower($annonce->produit->etat ?? 'neuf'); if (strpos($rawEtat, 'occasion') !== false) $normEtat = 'occasion'; elseif (strpos($rawEtat, 'reconditionne') !== false) $normEtat = 'reconditionne'; @endphp
@include('partials.product-card-premium', ['annonce' => $annonce])
@endforeach
@endif @else @endif @if($category->parent_id !== null)
{{ $annonces->links() }}
@endif
@endsection