@php $pricingOptions = $product->pricing->values(); $pricing = $pricingOptions->first(); $mrp = (float) ($pricing?->mrp ?? 0); $sellingPrice = (float) ($pricing?->selling_price ?? $mrp); $discount = $mrp > 0 && $sellingPrice < $mrp ? (int) round((($mrp - $sellingPrice) / $mrp) * 100) : 0; $quantityLabel = $pricing?->label ?: trim(implode(' ', array_filter([ $pricing?->variant?->value, $pricing?->unit?->nickname ?: $pricing?->unit?->name, ]))); $image = \App\Helpers\Helper::get_image($product->image) ?: asset('backend/template/images/no-image.png'); $timerEndsAt = $timerEndsAt ?? null; $stockStatus = $pricing?->resolveStockStatus() ?? \App\Models\ProductPricing::STOCK_OUT; $isPreorderNow = $stockStatus === \App\Models\ProductPricing::STOCK_OUT; $isAvailable = true; // Grid density is the caller's call — the Deals skin runs 5-up, everywhere // else keeps the 6-up row the card was built for. $cardColClass = $cardColClass ?? 'col-lg-2 col-md-4 col-4'; @endphp