@php /** * Style-1 grid card — shop card layout. * Image (with hover) → action overlay → single badge → quick-add → marquee → info block. * No flash-sale countdown overlay here — the demo only shows it inside * dedicated flash-sale sections, not on the standard shop card. * * Inputs: * $product \Botble\Ecommerce\Models\Product * $showQuickView bool * $showQuickShop bool */ use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; $showQuickView = $showQuickView ?? true; $showQuickShop = $showQuickShop ?? true; $primaryImage = RvMedia::getImageUrl($product->image, 'product-grid', false, RvMedia::getDefaultImage()); $hoverImage = null; if (! empty($product->images) && is_iterable($product->images)) { foreach ($product->images as $img) { if (! is_string($img) || trim($img) === '' || $img === $product->image) { continue; } $hoverImage = RvMedia::getImageUrl($img, 'product-grid', false, null); if ($hoverImage) { break; } } } $isOnSale = $product->front_sale_price !== null && $product->price > 0 && (float) $product->front_sale_price < (float) $product->price; $salePercent = $isOnSale ? (int) round((1 - ((float) $product->front_sale_price / (float) $product->price)) * 100) : 0; $productWrapperClass = trim((string) ($productWrapperClass ?? '')); // Per-context decoration toggles (defaults preserve existing behavior). $showActions = $showActions ?? true; $showBadges = $showBadges ?? true; $showMarquee = $showMarquee ?? true; @endphp