From d22f4c92105e94f771333c5794faf92c0cfbaac9 Mon Sep 17 00:00:00 2001 From: DualFroz Date: Wed, 26 Aug 2026 15:38:49 +0200 Subject: [PATCH] views: add base layout, home page and product card partial --- views/home.php | 57 +++++++++++++++++++++++++++ views/layout.php | 71 ++++++++++++++++++++++++++++++++++ views/partials/productCard.php | 58 +++++++++++++++++++++++++++ 3 files changed, 186 insertions(+) create mode 100644 views/home.php create mode 100644 views/layout.php create mode 100644 views/partials/productCard.php diff --git a/views/home.php b/views/home.php new file mode 100644 index 0000000..d0f4cf5 --- /dev/null +++ b/views/home.php @@ -0,0 +1,57 @@ +
+
+
+ Independent goods, fairly priced +

A small shop with a big appetite for good things.

+

Bazaar is a demo storefront running on a hand-rolled PHP microframework - real catalog, session cart, Stripe checkout and an admin back office. Browse the shelves.

+ +
+
+
+ +
+
+
+
+

Fresh on the shelves

+

The latest additions to the catalog.

+
+ View all → +
+ + +
+

No products yet. Seed the database or add one from the admin panel.

+
+ +
+ + renderPartial('partials.productCard', ['product' => $product, 'currency' => $currency]) ?> + +
+ +
+
+ + +
+
+
+

Shop by department

+
+
+ + + + · + + +
+
+
+ diff --git a/views/layout.php b/views/layout.php new file mode 100644 index 0000000..a8307cf --- /dev/null +++ b/views/layout.php @@ -0,0 +1,71 @@ + + + + + + <?= e($title ?? 'Bazaar - a small good shop') ?> + + + + + + + +
+ $message): ?> +
+ +
+ + +
+ +
+ + + + diff --git a/views/partials/productCard.php b/views/partials/productCard.php new file mode 100644 index 0000000..2cfb51b --- /dev/null +++ b/views/partials/productCard.php @@ -0,0 +1,58 @@ + +
+ +
+ + <?= e($product['name']) ?> + + + +
+
+
+ + + + + + 0): ?> +
+ + () +
+ + +
+ + 0 && $priceFromCents !== (int) $product['priceCents']): ?>from + + + + Sold out + + Only left + + In stock + +
+ + +
+ + + +
+ +
+