${p.name}
${p.desc}
/ ====== EDIT THESE ======
const SHOP_NAME = "Duka Yetu";
const WHATSAPP_NUMBER = "254700000000"; // country code + number, no "+" or spaces
const CURRENCY = "KES";
// Add your products here. Use "image" (a URL or file like "images/shoe.jpg") or leave it out to show the emoji.
const PRODUCTS = [
{ id: 1, name: "Cotton T-Shirt", category: "Clothing", price: 800, emoji: "👕", color: "#dcecf5", desc: "Soft, breathable, everyday fit." },
{ id: 2, name: "Canvas Sneakers", category: "Clothing", price: 2500, emoji: "👟", color: "#f5e3dc", desc: "Light and comfortable." },
{ id: 3, name: "Kitenge Tote Bag", category: "Accessories", price: 1200, emoji: "👜", color: "#f3ecc9", desc: "Handmade with bright kitenge fabric." },
{ id: 4, name: "Sunglasses", category: "Accessories", price: 900, emoji: "🕶️", color: "#e4dcf5", desc: "UV protection, lightweight frame." },
{ id: 5, name: "Ceramic Mug", category: "Home", price: 550, emoji: "☕", color: "#dcf5e6", desc: "350 ml, dishwasher safe." },
{ id: 6, name: "Scented Candle", category: "Home", price: 700, emoji: "🕯️", color: "#f5dce8", desc: "Vanilla and coconut, 30-hour burn." },
{ id: 7, name: "Wireless Earbuds", category: "Electronics", price: 3200, emoji: "🎧", color: "#dce1f5", desc: "Bluetooth 5.0, charging case." },
{ id: 8, name: "Phone Power Bank", category: "Electronics", price: 2800, emoji: "🔋", color: "#e9f5dc", desc: "10,000 mAh, fast charging." }
];
// ========================
const $ = (id) => document.getElementById(id);
const money = (n) => `${CURRENCY} ${n.toLocaleString()}`;
let cart = load();
let category = "All";
let query = "";
function load() {
try { return JSON.parse(localStorage.getItem("cart")) || {}; } catch { return {}; }
}
function save() {
try { localStorage.setItem("cart", JSON.stringify(cart)); } catch {}
}
function renderFilters() {
const cats = ["All", ...new Set(PRODUCTS.map(p => p.category))];
$("filters").innerHTML = cats.map(c =>
``).join("");
}
function renderProducts() {
const list = PRODUCTS.filter(p =>
(category === "All" || p.category === category) &&
p.name.toLowerCase().includes(query.toLowerCase()));
$("grid").innerHTML = list.length ? list.map(p => `
${p.desc}${p.name}
No products match your search.
`; } function renderCart() { const items = Object.entries(cart).map(([id, qty]) => ({ p: PRODUCTS.find(x => x.id == id), qty })).filter(i => i.p); $("cartItems").innerHTML = items.length ? items.map(({ p, qty }) => `