Live site: mauzo.hartech.co.ke
Building Mauzo Electronics: A PHP E-Commerce Platform for Kenyan Retailers
When you walk around any Kenyan town — Nairobi, Nakuru, Eldoret, Mombasa — you'll notice something: hundreds of small electronics shops, each packed with TVs, fridges, speakers, and phones. Walk into any of them and ask, "Can I buy this online?" Nine times out of ten, the answer is no.
That's the gap Mauzo Electronics was built to fill.
In this post, I'll walk you through how I built Mauzo (Swahili for "sales") — a PHP-based e-commerce platform designed specifically for Kenyan electronics retailers. I'll cover the architecture, the features, the challenges, and what I learned along the way.
The Problem
Small and mid-sized electronics retailers in Kenya face a tricky situation:
-
Big players dominate online. Jumia, Kilimall, and Jiji get the traffic, but they take commissions and control the customer relationship.
-
Facebook/WhatsApp selling is messy. It works, but you can't scale it — no catalog, no cart, no order management, no receipts.
-
Custom e-commerce is expensive. Hiring an agency to build a Shopify-style store costs hundreds of thousands of shillings that a shop owner doesn't have.
-
Existing solutions aren't localized. Many platforms don't support M-PESA natively, don't price in KSh properly, or aren't built for how Kenyan buyers actually shop.
Mauzo was built to solve this: a lightweight, affordable, PHP-powered storefront that any Kenyan retailer can run — complete with M-PESA, KSh pricing, and an admin panel that doesn't require a computer science degree.
The Tech Stack
I deliberately kept the stack simple, cheap to host, and easy to maintain:
| Layer | Technology | Why |
|---|---|---|
| Backend | PHP (procedural / light OOP) | Runs on almost any shared hosting in Kenya; no expensive server needed |
| Database | MySQL | Free, reliable, widely supported by cPanel hosts |
| Frontend | HTML5 + CSS3 + Bootstrap + vanilla JS | Fast, mobile-first, no build step required |
| Payments | M-PESA Daraja API | Native mobile money — the way Kenyans pay |
Core Features
1. Product Catalog
Products are organized by category (TVs, audio, home appliances, accessories), each with:
-
Name, brand, model number
-
Price in KSh
-
Multiple images
-
Specifications (screen size, resolution, power rating, etc.)
-
Stock status
2. Search & Filtering
Buyers can search by name or filter by category, brand, and price range. For electronics, filtering by specs (e.g. "32 inch", "Smart TV", "QLED") matters more than generic keyword search.
3. Cart & Checkout
A session-based cart that survives page reloads, followed by a simple checkout:
-
Guest checkout (no forced account creation — this kills conversions)
-
Delivery details form
-
Order summary with delivery fee
-
Payment method selection
4. M-PESA Integration
This was the most important feature. Using the Safaricom Daraja API (STK Push / Lipa Na M-PESA Online):
-
Customer enters their phone number at checkout
-
They receive an STK push prompt on their phone
-
They enter their M-PESA PIN
-
Daraja sends a callback to Mauzo confirming payment
-
Order is marked "Paid" and the customer sees a receipt
No card, no PayPal, no friction — just the payment method 90% of Kenyan buyers already use daily.
5. Admin Dashboard
Shop owners log in to manage everything:
-
Add/edit/delete products
-
Upload images
-
View and process orders
-
Update stock
-
See sales summaries
Designed to be usable on a phone, because most shop owners don't sit at a desk.
Challenges I Ran Into (And How I Solved Them)
Challenge 1: M-PESA Callback Reliability
The Daraja API sends payment confirmations to a callback URL on your server. On shared hosting, this occasionally failed or timed out.
Solution: I built a verification fallback — if the callback doesn't arrive within a few seconds, the system queries Daraja's transaction status endpoint directly and reconciles the order. Never trust a single callback.
Challenge 2: Product Images on Slow Connections
Electronics shops upload high-resolution product photos. On 3G, those images killed page load.
Solution:
-
Compress and resize on upload (server-side with GD/Imagick)
-
Serve responsive sizes
-
Add
loading="lazy"on all product images -
Use a CDN for static assets where possible
Page loads dropped from ~8 seconds to under 2 seconds on mobile.
Challenge 3: Product Titles Getting Messy
Early on, auto-generated product names pulled in every attribute, producing titles like:
"Vitron HTC3288QS, 32 inch QLED Smart Android TV, QLED Smart TV, Android TV, Q LED - Black"
Solution: A structured product schema — brand, model, size, and category are stored separately and composed into a clean title at render time. Result:
"Vitron HTC3288QS 32" QLED Smart Android TV – Black"
Cleaner for buyers, and much better for SEO.
Challenge 4: Preventing SQL Injection
Since I was writing raw PHP with MySQL queries, security was a real concern.
Solution: Every single query uses PDO prepared statements. No exceptions. User input is never concatenated into SQL. I also added:
-
CSRF tokens on all forms
-
htmlspecialchars()on all output -
Session regeneration on login
-
Password hashing with
password_hash()
What I Learned
-
Localization beats features. A single M-PESA integration is worth more to a Kenyan shop than ten fancy features.
-
Simple stacks win for small businesses. PHP + MySQL isn't trendy, but it's affordable and it works everywhere.
-
Mobile-first isn't optional. Over 80% of traffic comes from phones. If the admin panel isn't mobile-friendly, it doesn't get used.
-
Security is not optional, even for small projects. Prepared statements, CSRF tokens, and input validation cost nothing and prevent disasters.
-
Ship, then improve. The first version wasn't perfect. It's the iterations — SEO, image optimization, title cleanup — that made it good.
What's Next for Mauzo
-
WhatsApp order notifications for buyers and shop owners
-
Multi-vendor support so several shops can run under one platform
-
Delivery tracking with SMS updates
-
Product reviews & ratings
-
A mobile app for shop owners to manage orders on the go
Try It Out
The live demo is at mauzo.hartech.co.ke.
If you're a Kenyan retailer tired of losing sales to commissions and messy WhatsApp chats — or a developer curious about building localized e-commerce — feel free to reach out.
Built with PHP, MySQL, and a lot of M-PESA test transactions.

