@extends('layouts.front-end.app') @section('title', ($promotion->name ?? translate('promotion_products')) . ' | ' . ($web_config['name']->value ?? '')) @push('css_or_js') @endpush @section('content') @php $decimal_point_settings = getWebConfig(name: 'decimal_point_settings') ?? 0; $hasTimer = !is_null($promotion->ends_at); $now = \Carbon\Carbon::now(); $start = $promotion->starts_at ? \Carbon\Carbon::parse($promotion->starts_at) : $now; $end = $promotion->ends_at ? \Carbon\Carbon::parse($promotion->ends_at) : $now; $total = max($end->diffInSeconds($start), 1); $elapsed = min(max($now->diffInSeconds($start), 0), $total); $progress = $hasTimer ? ($elapsed / $total) * 100 : 0; // صورة بانر احتياطية إن ما في بانر مخصّص $deal_banner = theme_asset(path: 'public/assets/front-end/img/flash-deals.png'); @endphp
{{-- هيدر العرض: بانر + عدّاد (إن وجد) --}}
@if($hasTimer)
{{ translate('days') }} : {{ translate('hrs') }} : {{ translate('min') }} : {{ translate('sec') }}
@endif
{{-- عنوان العرض + وصف مختصر/شارة الخصم --}}
{{ $promotion->name }} @if($promotion->discount_percent) -{{ (float) $promotion->discount_percent }}% @endif
@if(!empty($promotion->description)) {{ $promotion->description }} @else {{ translate('enjoy_the_best_offers_on_selected_items') }} @endif
{{-- شبكة المنتجات --}}
@if($products->count() > 0)
@foreach($products as $product)
{{-- يمكنك التبديل بين الكرتين حسب هويتك: _inline-single-product أو _product-card-1 --}} @include('web-views.partials._inline-single-product', [ 'product' => $product, 'decimal_point_settings' => $decimal_point_settings ])
@endforeach
{{-- Pagination --}} @if(method_exists($products, 'links'))
{{ $products->links() }}
@endif @else
{{ translate('no_products_found') }}
@endif
@endsection @push('script') {{-- نفس سكربت العدّاد المستعمل في الفلاش ديلز --}} @endpush