@if($activePromotion && $promotionProducts->count() > 0) @php $decimal_point_settings = $decimal_point_settings ?? (getWebConfig(name: 'decimal_point_settings') ?? 0); $hasTimer = !is_null($activePromotion->ends_at); $now = \Carbon\Carbon::now(); $start = $activePromotion->starts_at ? \Carbon\Carbon::parse($activePromotion->starts_at) : $now; $end = $activePromotion->ends_at ? \Carbon\Carbon::parse($activePromotion->ends_at) : $now; $total = max($end->diffInSeconds($start), 1); $elapsed = min(max($now->diffInSeconds($start), 0), $total); $progress = $hasTimer ? ($elapsed / $total) * 100 : 0; @endphp
{{ $activePromotion->name }} @if($activePromotion->discount_percent) -{{ (float)$activePromotion->discount_percent }}% @endif
{{-- View all (ويب) --}}
{{-- البطاقة الجانبية: عدّاد + شريط تقدم (إن وُجد تاريخ انتهاء) --}} @if($hasTimer) {{-- Desktop carousel --}}
{{-- Mobile carousel --}}
@else {{-- بدون عدّاد: نعتمد سلايدر واحد بعرض واسع --}}
@endif {{-- View all (موبايل) --}}
@endif