@php $variants = $product->variants ?? collect(); $inStock = $variants->where('in_stock', true); $minPrice = $inStock->min('price') ?? 0; $maxPrice = $inStock->max('price') ?? 0; $allColors = $inStock->whereNotNull('color_code')->unique('color_code')->values(); $isOutOfStock = $inStock->isEmpty(); // Discount: compare max price to min price (printful products vary by color/size) $hasRange = $minPrice !== $maxPrice; @endphp
id) }}'>{{ $product->title }}
@if($allColors->count() > 0)
{{-- 1. Yahan horizontal padding (px-6) add ki hai --}} {{-- Left arrow --}} {{-- Scroll Track --}}
{{-- 2. Inline padding for safety --}} @foreach($allColors as $color)
@endforeach
{{-- Right arrow --}}
@endif
@if($isOutOfStock) Out of Stock @else @if($hasRange) ${{ number_format($minPrice, 2) }} - ${{ number_format($maxPrice, 2) }} @else ${{ number_format($minPrice, 2) }} @endif {{ $product->currency }} @endif