@if($showTitle && count($products) > 0)

{{ $title }}

@if($type === 'trending') Voir tout @endif
@endif @if($loading)
@for($i = 0; $i < $limit; $i++)
@endfor
@elseif(count($products) > 0)
@foreach($products as $product) @php $productName = $product['nom'] ?? $product['designation'] ?? 'Produit'; @endphp
@php $imageUrl = null; if (!empty($product['images'])) { $img = $product['images'][0]; $imageUrl = $img['url'] ?? $img['chemin'] ?? $img['image'] ?? null; if ($imageUrl && !str_starts_with($imageUrl, 'http')) { $imageUrl = 'https://tawfeexmarket.com/storage/' . $imageUrl; } } @endphp @if($imageUrl) {{ $productName }} @else
@endif @if(!empty($product['ancien_prix']) && $product['ancien_prix'] > $product['prix']) @php $discount = round((($product['ancien_prix'] - $product['prix']) / $product['ancien_prix']) * 100); @endphp
-{{ $discount }}%
@endif @if($type === 'trending')
@endif

{{ $productName }}

@if(strlen($productName) > 25) @endif
@if(!empty($product['shop']['nom']) || !empty($product['shop']['name']))

{{ $product['shop']['nom'] ?? $product['shop']['name'] }}

@endif
{{ number_format($product['prix'] ?? 0, 0, ',', ' ') }} F @if(!empty($product['ancien_prix']) && $product['ancien_prix'] > $product['prix']) {{ number_format($product['ancien_prix'], 0, ',', ' ') }} F @endif
@endforeach
@else

Aucune recommandation disponible

@endif