<?php require_once __DIR__ . '/../app/bootstrap.php'; $pageTitle = BRAND_NAME . ' | Purchase Haat Marketplace'; $products = App\Core\Database::fetchAll('SELECT p.*, v.shop_name FROM products p LEFT JOIN vendors v ON v.id=p.vendor_id WHERE p.status="published" ORDER BY p.is_featured DESC, p.id DESC LIMIT 12'); if (!$products) $products = sample_products(); include ROOT_PATH . '/app/Layouts/frontend_header.php'; ?>
<section class="container py-5"><div class="hero-smart p-4 p-lg-5"><div class="row align-items-center g-5"><div class="col-lg-6"><span class="hero-badge">Smart Tech OMP official marketplace</span><h1 class="display-4 fw-bold mt-3">Buy, sell, earn rewards and grow affiliate income.</h1><p class="lead text-muted">A Bangladesh-ready multi-vendor platform with delivery zones, wallet, purchase points, product landing pages, barcode/QR labels and PSA-based affiliate distribution.</p><div class="d-flex flex-wrap gap-2"><a class="btn btn-primary btn-lg" href="<?= url('public/products.php') ?>">Shop Now</a><a class="btn btn-outline-primary btn-lg" href="<?= url('public/register.php?role=vendor') ?>">Become a Vendor</a></div></div><div class="col-lg-6"><img class="img-fluid rounded-4 shadow" src="<?= asset('images/gallery/slider/slide-1.png') ?>" alt="Smart Tech OMP"></div></div></div></section>
<section class="container py-4"><div class="row g-3"><div class="col-md-3"><div class="feature-pill"><strong>Multi-vendor</strong><p class="mb-0 small text-muted">Vendor stores, commission and payouts.</p></div></div><div class="col-md-3"><div class="feature-pill"><strong>Reward + Wallet</strong><p class="mb-0 small text-muted">Purchase points, cash and purchase wallets.</p></div></div><div class="col-md-3"><div class="feature-pill"><strong>Barcode + QR</strong><p class="mb-0 small text-muted">Printable labels with product payloads.</p></div></div><div class="col-md-3"><div class="feature-pill"><strong>Affiliate Marketing</strong><p class="mb-0 small text-muted">PSA ranks, royalty and statements.</p></div></div></div></section>
<section class="container py-4"><div class="d-flex justify-content-between align-items-center mb-3"><h2 class="section-title">Featured Products</h2><a href="<?= url('public/products.php') ?>">View all</a></div><div class="row g-4"><?php foreach($products as $p): ?><div class="col-md-6 col-lg-3"><div class="product-card"><a href="<?= url('product/'.$p['slug']) ?>"><img class="w-100" src="<?= e(product_image($p)) ?>" alt="<?= e($p['name']) ?>"></a><div class="p-3"><div class="small text-muted"><?= e($p['shop_name'] ?? BRAND_NAME) ?></div><h6 class="mb-1"><a class="text-dark text-decoration-none" href="<?= url('product/'.$p['slug']) ?>"><?= e($p['name']) ?></a></h6><div class="price"><?= money($p['sale_price'] ?: $p['regular_price']) ?></div><div class="d-flex gap-2 mt-3"><button class="btn btn-primary btn-sm flex-fill" onclick="phAddCart(<?= (int)$p['id'] ?>,1)">Add Cart</button><a class="btn btn-outline-secondary btn-sm" href="<?= url('api/qr-code.php?id='.(int)$p['id']) ?>" target="_blank">QR</a></div></div></div></div><?php endforeach; ?></div></section>
<section class="container py-4"><div class="landing-hero p-4 p-lg-5"><div class="row align-items-center"><div class="col-lg-8"><h2 class="fw-bold">Start selling with Smart Tech OMP</h2><p class="mb-lg-0">Vendors and marketing members get shop pages, product selection, QR links, social sharing and wallet tracking.</p></div><div class="col-lg-4 text-lg-end"><a class="btn btn-light btn-lg" href="<?= url('public/register.php?role=vendor') ?>">Register Vendor</a></div></div></div></section>
<?php include ROOT_PATH . '/app/Layouts/frontend_footer.php'; ?>
