@extends('ecommerce::layout.store-layout') @php $title = static fn($value) => is_array($value) ? ($value[app()->getLocale()] ?? $value['en'] ?? reset($value)) : ($value ?: ''); $image = static fn($value) => $value ?: asset('assets/images/pro/1.jpg'); $currencySymbol = \App\Domain\AppBase\Models\Setting\Currency::symbol(); @endphp @section('title', __('ecommerce::ecommerce.special_offers')) @section('active-nav', 'offers') @section('page-styles') @endsection @section('content')
{{-- 1. Hero Promotional Campaign Banner --}}
@lang('ecommerce::ecommerce.flash_sale')

@lang('ecommerce::ecommerce.special_offers_hero_title')

@lang('ecommerce::ecommerce.special_offers_hero_desc')

@lang('ecommerce::ecommerce.ends_in')
02
@lang('ecommerce::ecommerce.days')
:
14
@lang('ecommerce::ecommerce.hours')
:
35
@lang('ecommerce::ecommerce.mins')
:
42
{{ app()->getLocale() === 'ar' ? 'ثانية' : 'Secs' }}
{{-- 2. Exclusive Coupons / Vouchers Section --}} @if(!empty($vouchers))

@lang('ecommerce::ecommerce.exclusive_vouchers')

@lang('ecommerce::ecommerce.exclusive_vouchers_desc')
@foreach($vouchers as $voucher)

{{ $voucher['title'] }}

{{ $voucher['subtitle'] }}

{{ $voucher['badge'] }}
{{ $voucher['code'] }}
@endforeach
@endif {{-- 3. Category Filter Strip --}} @if($categories->isNotEmpty())
@lang('ecommerce::ecommerce.all_offers')
@foreach($categories as $category)
@if($category->icon) @else @endif
{{ $title($category->title) }}
({{ $category->items_count }})
@endforeach
@endif {{-- 4. Toolbar: Discount Range Pills & Sort Dropdown --}}
@if(request('category')) @endif @if(request('discount_range')) @endif @if(request('q')) @endif
{{-- 5. Products Offers Grid --}}
@forelse($products as $product)
{{-- Percentage Discount Ribbon — from Item::getDiscountPercentAttribute() --}} @php $discountPct = $product->discount_percent; @endphp
{{ $discountPct }}% @lang('ecommerce::ecommerce.off')
{{-- Wishlist / Favorite Button --}} {{-- Product Image Wrap --}} {{ $title($product->title) }} {{-- Flash badge: show when offer expires within 24 hours --}} @if($product->sale_expires_at && $product->sale_expires_at->diffInHours(now()) <= 24) @php $hoursLeft = max(0, (int) now()->diffInHours($product->sale_expires_at, false)); @endphp
@lang('ecommerce::ecommerce.ends_in') {{ $hoursLeft }} @lang('ecommerce::ecommerce.hours')
@endif
{{-- Merchant / Store Name --}} @if($product->merchant) @endif {{-- Product Title --}}

{{ $title($product->title) }}

{{-- Rating --}}
★★★★★ ({{ number_format((float) ($product->rating ?? 4.9), 1) }})
{{-- Price Area — all values from real DB columns via Item model --}}
{{-- sale_price is the real discounted price from DB --}} {{ \App\Domain\AppBase\Models\Setting\Currency::format((float) $product->sale_price) }} {{-- default_price is the original price from DB --}} {{ \App\Domain\AppBase\Models\Setting\Currency::format((float) $product->default_price) }}
@lang('ecommerce::ecommerce.save_amount', [ 'amount' => \App\Domain\AppBase\Models\Setting\Currency::format( (float) $product->default_price - (float) $product->sale_price ) ])
{{-- Add to Cart Form --}}
@csrf @if(method_exists($product, 'isInStock') && !$product->isInStock()) @else @endif
@empty

@lang('ecommerce::ecommerce.no_offers_found')

@lang('ecommerce::ecommerce.no_products_desc')

@lang('ecommerce::ecommerce.view_all_offers')
@endforelse
{{-- 6. Pagination --}} @if($products->hasPages())
@if(!$products->onFirstPage()) @lang('ecommerce::ecommerce.previous') @else @lang('ecommerce::ecommerce.previous') @endif {!! $products->links('pagination::bootstrap-4') !!} @if($products->hasMorePages()) @lang('ecommerce::ecommerce.next') @else @lang('ecommerce::ecommerce.next') @endif
@endif
{{-- Toast Notification Box --}}
@lang('ecommerce::ecommerce.copied')
@endsection @section('scripts') @endsection