Shop

@php $isMobile = preg_match( '/(android|iphone|ipad|ipod|blackberry|opera mini|iemobile|mobile)/i', $_SERVER['HTTP_USER_AGENT'], ); @endphp
Clear @if ($isMobile)
@endif
@if ($isMobile) @endif @if (!$isMobile) {{--
New arrivals
@foreach ($getNewArrivalProducts as $product)
{{ $product->product_name }}
₹{{ number_format($product->base_price, 0, '.', ',') }}₹{{ number_format($product->base_price, 0, '.', ',') }}
@endforeach
--}} @endif
@if ($categoryIds && count($categoryIds) > 0) @if (count($parentCategoryIds) > 0) @else @endif @php $colors = [ '#ef4444', '#f59e0b', '#10b981', '#3b82f6', '#6366f1', '#ec4899', '#14b8a6', '#8b5cf6', ]; @endphp @foreach ($sub_categories as $subcat) @php $color = $colors[array_rand($colors)]; @endphp @endforeach {{-- --}} @endif
{{-- Add this CSS block to fix the responsive issues without changing HTML --}} {{-- Your existing HTML structure remains exactly the same --}} @php $totalProducts = count($products); $rowHeight = 500.109; // Calculate container heights for different breakpoints $desktopRows = ceil($totalProducts / 4); $xlRows = ceil($totalProducts / 3); $smRows = ceil($totalProducts / 2); $xsRows = $totalProducts; @endphp
  • @forelse ($products as $index => $product) @php $isInWishlist = $wishlist->contains('product_id', $product->product_id); // dd($wishlist, $product->product_id); $mrp = $product->variations[0]->mrp ?? $product->base_mrp; $price = $product->variations[0]->price ?? $product->base_price; $percentOff = $mrp > 0 && $price > 0 ? round((($mrp - $price) / $mrp) * 100) : 0; // Calculate positioning for different breakpoints // Desktop (4 columns) $desktopCol = $index % 4; $desktopRow = floor($index / 4); $desktopLeft = $desktopCol * 25; $desktopTop = $desktopRow * $rowHeight; // XL screens (3 columns) $xlCol = $index % 3; $xlRow = floor($index / 3); $xlLeft = $xlCol * 33.3333; $xlTop = $xlRow * $rowHeight; // SM screens (2 columns) $smCol = $index % 2; $smRow = floor($index / 2); $smLeft = $smCol * 50; $smTop = $smRow * $rowHeight; // XS screens (1 column) $xsLeft = 0; $xsTop = $index * $rowHeight; @endphp
  • {{-- @dd($product->variation) --}} @if ($product->variation)
    @if ($product->on_sale) Sale @endif
    @if ($product->variation->stock == 0) Out of stock @else Add to cart @endif
    @endif
  • @empty

    No Product Found

    @endforelse
@if (count($products) > 0) {{ $products->links() }} @endif