Most small restaurants and cafes in Egypt and the wider MENA region already take orders on WhatsApp. The problem is the messy part: customers send photos of the menu, voice notes, half sentences, and someone has to turn that into an order.
A static site can fix this without a server, a database or a delivery-app commission. The page shows the menu, the customer builds a cart, and the page opens WhatsApp with a ready, structured order message. This post shows the core idea so you can build it yourself, and I added a ready-made version at the end.
How it works
- The menu lives in one
menu.jsonfile (categories, items, sizes, extras, prices, in Arabic and English). - The page renders the menu and keeps a cart in memory (and in
localStorageso a refresh does not lose it). - On checkout, the page builds a text message and opens
https://wa.me/<number>?text=<encoded message>. - The restaurant receives one clean message per order in its own WhatsApp.
No backend means free hosting (Cloudflare Pages, GitHub Pages, Netlify) and nothing to maintain.
The part that matters: building the message
function buildOrderMessage(cart, opts) { const lines = []; lines.push(`New order - ${opts.restaurantName}`); if (opts.table) lines.push(`Table: ${opts.table}`); lines.push(`Type: ${opts.mode}`); // delivery | pickup | dine-in lines.push(""); let subtotal = 0; for (const it of cart) { const extras = it.extras.map(e => e.name).join(", "); const lineTotal = (it.price + it.extras.reduce((s, e) => s + e.price, 0)) * it.qty; subtotal += lineTotal; lines.push(`${it.qty} x ${it.name}${it.size ? " (" + it.size + ")" : ""}${extras ? " + " + extras : ""} = ${lineTotal}`); } const fee = opts.mode === "delivery" ? opts.deliveryFee : 0; const tax = Math.round((subtotal * opts.taxPercent) / 100); lines.push(""); lines.push(`Subtotal: ${subtotal}`); if (fee) lines.push(`Delivery: ${fee}`); if (tax) lines.push(`Tax: ${tax}`); lines.push(`Total: ${subtotal + fee + tax}`); if (opts.customerName) lines.push(`Name: ${opts.customerName}`); if (opts.address) lines.push(`Address: ${opts.address}`); return lines.join("\n"); } function sendToWhatsApp(number, message) { const url = `https://wa.me/${number}?text=${encodeURIComponent(message)}`; window.open(url, "_blank"); } Use the number in international format with digits only (for Egypt, 201XXXXXXXXX). encodeURIComponent handles Arabic text and line breaks correctly.
Details that decide whether it feels professional
- Right-to-left. Set
dir="rtl"on the container for Arabic and use logical CSS properties (margin-inline-start,padding-inline-end) so one stylesheet works for both languages. - Table QR codes. Print one QR per table pointing to
https://your-site/?table=7. Read it withnew URLSearchParams(location.search).get("table")and include it in the message. Waiters then know where to go. - Open/closed badge. Compare the current time against opening hours in the restaurant's time zone, not the visitor's.
- Minimum order and delivery fee. Check them before enabling the checkout button, and show the reason when it is disabled.
- Offline and installable. A small service worker plus a web manifest makes the menu open instantly on a weak mobile connection and lets customers add it to the home screen.
- Sold-out items. One
"available": falseflag in the JSON is enough. The owner should be able to flip it without touching code.
What a static site cannot do
Be honest with the restaurant owner about the limits. There is no card payment inside the menu, no order history dashboard and no automatic status updates. The order is a WhatsApp message and payment happens on delivery or as agreed with the customer. For many small places this is exactly what they want, because it fits how they already work. If you need online payment or a kitchen screen, you need a backend.
A ready-made version
I packaged this into a kit so you do not have to build the editor and the QR tooling yourself: Arabic and English menu, cart with sizes and extras, delivery/pickup/dine-in, WhatsApp order message with table number, a visual menu editor, printable QR table cards, and a short guide for freelancers on finding restaurant clients and pricing the setup.
- Live demo (a sample Egyptian koshary restaurant): https://dinekit-demo.pages.dev
- Kit: https://eslamsheref6.gumroad.com/l/wjzfln
Disclosure: I made the kit and the link above is a paid product. The code in this post is free to use as it is.
If you build something similar, I would like to hear what you handle differently, especially around opening hours and Arabic number formatting.