@php /** * Per-card flash-sale countdown. * Compact single-line pill: "02D : 16H : 32M : 57S". * Renders only when the product has at least one active flash sale. * The countdown widget is wired via [data-countdown] in ecommerce.js, * which writes into [data-countdown-{unit}] spans. * * Input: $product */ $flashSale = null; if (method_exists($product, 'latestFlashSales')) { try { $flashSale = $product->latestFlashSales()->first(); } catch (\Throwable $e) { $flashSale = null; } } if (! $flashSale || ! $flashSale->end_date) { return; } $targetDate = $flashSale->end_date->endOfDay()->toIso8601String(); @endphp
00{{ __('D') }} : 00{{ __('H') }} : 00{{ __('M') }} : 00{{ __('S') }}