@php $isWishlisted = in_array($product->id, $userWishlistIds ?? []); $hasVariants = $product->variants && $product->variants->count() > 0; // Compile Pack Options (BigBasket style) $packOptions = []; if ($hasVariants) { foreach ($product->variants as $var) { $packOptions[] = [ 'id' => $var->id, 'name' => $var->variant_name, 'weight' => $var->weight ?: $var->variant_name, 'selling_price' => (float)$var->selling_price, 'effective_price' => (float)$var->effective_price, 'discount_percent' => (int)$var->discount_percent, 'stock_quantity' => (int)$var->stock_quantity, 'is_in_stock' => $var->stock_quantity > 0, ]; } } else { $packOptions[] = [ 'id' => null, 'name' => $product->weight ?: ($product->unit ? '1 ' . $product->unit : 'Standard Pack'), 'weight' => $product->weight ?: ($product->unit ? '1 ' . $product->unit : 'Standard Pack'), 'selling_price' => (float)$product->selling_price, 'effective_price' => (float)$product->effective_price, 'discount_percent' => (int)$product->discount_percent, 'stock_quantity' => (int)$product->stock_quantity, 'is_in_stock' => $product->stock_quantity > 0, ]; } $initialPack = $packOptions[0]; @endphp
{{ $product->name }}
30 MINS
{{ $product->brand ?? ($product->category->name ?? 'Daily Grocery') }}
{{ $product->name }}