@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