88 lines
3.5 KiB
PHP
88 lines
3.5 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
require_once __DIR__ . '/includes/bootstrap.php';
|
|
require_once __DIR__ . '/includes/layout.php';
|
|
|
|
$categories = get_categories();
|
|
$featured = get_products(null, null, 'price_desc');
|
|
$featured = array_slice($featured, 0, 3);
|
|
|
|
render_header('E-SO9 Storefront', 'home');
|
|
?>
|
|
<main class="container my-5">
|
|
<section class="hero mb-5">
|
|
<div class="row align-items-center g-4">
|
|
<div class="col-lg-7">
|
|
<span class="badge badge-soft mb-3">Professional ecommerce MVP</span>
|
|
<h1 class="display-6 fw-semibold mb-3">E-SO9 curated storefront with fast checkout and admin tracking.</h1>
|
|
<p class="text-muted mb-4">Browse products, add to cart, place a demo order, and track status. Admins can review orders and update fulfillment.</p>
|
|
<div class="d-flex gap-3">
|
|
<a href="/shop.php" class="btn btn-primary">Start shopping</a>
|
|
<a href="/track.php" class="btn btn-outline-secondary">Track an order</a>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-5">
|
|
<div class="stat-card">
|
|
<div class="row g-3">
|
|
<div class="col-6">
|
|
<div class="text-muted small">Categories</div>
|
|
<div class="h4 mb-0"><?= e((string) count($categories)) ?></div>
|
|
</div>
|
|
<div class="col-6">
|
|
<div class="text-muted small">Active products</div>
|
|
<div class="h4 mb-0">6</div>
|
|
</div>
|
|
<div class="col-12">
|
|
<div class="text-muted small">Checkout status</div>
|
|
<div class="fw-semibold">Demo payments enabled</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="mb-5">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h2 class="h5 mb-0">Browse by category</h2>
|
|
<a href="/shop.php" class="link-secondary">See all products</a>
|
|
</div>
|
|
<div class="row g-3">
|
|
<?php foreach ($categories as $category): ?>
|
|
<div class="col-md-4">
|
|
<div class="stat-card h-100">
|
|
<div class="text-muted small">Category</div>
|
|
<div class="h5 mb-2"><?= e($category['name']) ?></div>
|
|
<a href="/shop.php?category=<?= e((string) $category['id']) ?>" class="btn btn-outline-secondary btn-sm">Explore</a>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
|
|
<section>
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h2 class="h5 mb-0">Featured products</h2>
|
|
<span class="text-muted small">Hand-picked for the launch</span>
|
|
</div>
|
|
<div class="row g-4">
|
|
<?php foreach ($featured as $product): ?>
|
|
<div class="col-md-4">
|
|
<div class="product-card h-100">
|
|
<img src="<?= e($product['image_url'] ?: product_image_data($product['name'])) ?>" class="img-fluid" alt="<?= e($product['name']) ?>" width="600" height="400" />
|
|
<div class="p-3">
|
|
<div class="text-muted small mb-1"><?= e($product['category_name'] ?? 'General') ?></div>
|
|
<h3 class="h6 mb-2"><?= e($product['name']) ?></h3>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<span class="fw-semibold"><?= e(format_price((float) $product['price'])) ?></span>
|
|
<a href="/product.php?id=<?= e((string) $product['id']) ?>" class="btn btn-outline-secondary btn-sm">View</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<?php render_footer(); ?>
|