@extends('layouts.app') @section('content')
{{-- Hero Banner --}}
Hero Banner
{{-- Shop by Category --}} @if($categories->count() > 0)

Shop by Category

@php $categoryEmojis = [ '🎨', // Arts '✂️', // Crafts '🧸', // Toys '📚', // Educational '🎒', // School '📝', // Paper Items '🎁', // Gifts '🍼', // Baby Toys '🧩', // Puzzle '🎲', // Games ]; @endphp
@endif {{-- Reusable Product Card Macro-like structure --}} @php $renderProductCard = function($product) { $price = number_format($product->price, 0); $comparePrice = $product->compare_price ? number_format($product->compare_price, 0) : null; $route = route('product.show', $product->slug); $cartRoute = route('cart.add'); $img = !empty($product->thumbnail) ? $product->thumbnail_url : 'https://images.unsplash.com/photo-1558066110-bf9b8b0e71ce?q=80&w=400&auto=format&fit=crop'; $name = $product->name; $id = $product->id; $isOutOfStock = $product->stock_quantity <= 0; // Wishlist heart $wishlistIcon = ""; // Rating stars $stars = "
(0.0)
"; return "
{$wishlistIcon} {$name}
{$name} {$stars}
৳{$price} " . ($comparePrice ? "৳{$comparePrice}" : "") . "
" . csrf_field() . "
" . csrf_field() . "
"; }; @endphp {{-- Our Featured Products --}} @if($featuredProducts->count() > 0)

Our Featured Products

@foreach($featuredProducts->take(8) as $product) {!! $renderProductCard($product) !!} @endforeach
@endif {{-- Section: Arts Supplies --}} @if($newArrivals->count() > 0)

Arts Supplies

View All >
@foreach($newArrivals->take(4) as $product) {!! $renderProductCard($product) !!} @endforeach
@endif {{-- Section: Craft Supplies --}} @if($trendingProducts->count() > 0)

Craft Supplies

View All >
@foreach($trendingProducts->take(4) as $product) {!! $renderProductCard($product) !!} @endforeach
@endif {{-- Section: Toys & Games --}} @if($bestsellers->count() > 0)

Toys & Games

View All >
@foreach($bestsellers->take(4) as $product) {!! $renderProductCard($product) !!} @endforeach
@endif {{-- Section: Gifts --}} @if($featuredProducts->count() > 4)

Gifts

View All >
@foreach($featuredProducts->skip(4)->take(4) as $product) {!! $renderProductCard($product) !!} @endforeach
@endif
@endsection