You're browsing as a guest. Sign in for faster form filling and order tracking.
Free Delivery For orders above KSh 5,000/=
AboutFAQ

Drag & drop your prescription image here, or click to browse

Accepted: JPG, PNG, PDF — Max 5MB

✅ A licensed pharmacist will review your prescription and contact you within 1 hour during business hours. All prescriptions are handled confidentially.
Chat on WhatsApp '); } catch(e) {} } // Read file, compress, then upload var reader = new FileReader(); reader.onload = function(e) { btn.textContent = 'Uploading...'; compressImage(e.target.result, 1600, 0.8, function(compressed) { fetch('/api/prescription', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: document.querySelector('input[placeholder*="Full Name"]').value, phone: document.querySelector('input[placeholder*="Phone"]').value, email: document.querySelector('input[placeholder*="Email"]').value, deliveryMethod: document.querySelector('select').value, nearestStore: document.querySelectorAll('select')[1].value, notes: document.querySelector('textarea').value, fileName: fileInput.files[0].name, fileSize: Math.round(fileInput.files[0].size / 1024), fileBase64: compressed }) }) .then(function(r) { return r.json(); }) .then(function(result) { if (result.success) { sendWhatsApp(result.viewUrl, waWindow); } else { alert('Upload failed: ' + (result.error || 'Unknown error')); btn.disabled = false; btn.textContent = origText; } }) .catch(function(err) { alert('Upload error. Please try again.'); btn.disabled = false; btn.textContent = origText; }); }); }; reader.readAsDataURL(fileInput.files[0]); }); function sendWhatsApp(viewUrl, waWindow) { var data = {}; var inputs = document.querySelector('.contact-form').querySelectorAll('input:not([type=file]), select, textarea'); inputs.forEach(function(inp) { var label = ''; var prev = inp.previousElementSibling; if (prev && prev.tagName === 'LABEL') label = prev.textContent.replace(' *','').replace('\u00a0','').trim(); data[label || inp.placeholder || 'input'] = inp.value || '(empty)'; }); var fileInput = document.getElementById('prescFile'); data['Prescription File'] = fileInput.files[0].name + ' (' + Math.round(fileInput.files[0].size / 1024) + 'KB)'; data['View Prescription'] = viewUrl; // Build WhatsApp message var msg = '*New Prescription Submission*\n'; for (var key in data) { msg += '\n*' + key + ':* ' + data[key]; } msg += '\n\n_Submitted via Obwocha Pharmacy website_'; // Use pre-opened popup if available, otherwise navigate directly var waUrl = 'https://wa.me/+254727747699?text=' + encodeURIComponent(msg); if (waWindow && !waWindow.closed) { waWindow.location.href = waUrl; } else { window.location.href = waUrl; } // Success screen document.querySelector('.contact-form').innerHTML = '

Prescription Submitted!

A pharmacist will review and contact you within 1 hour.

Back to Home
'; if (typeof updateCartBadge === 'function') updateCartBadge(); }