Loading Wonderful Dragon Fruit...

Item added to cart!

Wonderful
Dragon Fruit Africa

Premium organic pitaya harvested from the heart of South Africa. Sustainable farming, vibrant flavor, delivered to your door.

Our Harvest

Freshly picked and packed with care

Bestseller Dragon Fruit Vine

Organic Red Pitaya

Sweet, juicy, and bursting with antioxidants. Perfect for breakfast bowls.

In Stock
R120 R99.00
Premium Dragon Fruit Cross Section

White Dragon Fruit

Milder flavor with crunchy black seeds. Ideal for smoothies.

In Stock
R110 R89.00
Family Pack Harvest Boxes

Family Box (5kg)

A generous assortment of red and white varieties. Great value.

Low Stock
R450 R399.00
const products = [ {id:1, name:"Classic Red Pitaya 1kg", price:14999, oldPrice:17999, stock:12, badge:"Bestseller", img:"images/hero-aerial.jpg", desc:"Premium red-fleshed dragon fruit, hand-picked at peak ripeness."}, {id:2, name:"Yellow Dragon Fruit 1kg", price:16999, oldPrice:19999, stock:8, badge:"Premium", img:"images/fruit-vine.jpg", desc:"Sweet golden variety with vibrant yellow skin and white flesh."}, {id:3, name:"Organic Mixed Box 3kg", price:34999, oldPrice:39999, stock:5, badge:"Family Pack", img:"images/harvest-boxes.jpg", desc:"Assorted premium dragon fruits perfect for the whole family."}, {id:4, name:"Premium Gift Box", price:24999, oldPrice:29999, stock:3, badge:"Gift", img:"images/cross-section.jpg", desc:"Elegant gift presentation of our finest dragon fruits."} ]; function formatPrice(cents) { return `R${(cents / 100).toFixed(2)}`; } function renderProducts() { const productsGrid = document.getElementById('products-grid'); productsGrid.innerHTML = ''; products.forEach(product => { const productCard = document.createElement('div'); productCard.classList.add('product-card'); productCard.innerHTML = ` ${product.name} ${product.badge}

${product.name}

${product.desc}

Stock: ${product.stock > 0 ? product.stock : 'Out of Stock'}

Was: ${formatPrice(product.oldPrice)}

Now: ${formatPrice(product.price)}

`; productsGrid.appendChild(productCard); }); } function addToCart(id) { const cart = JSON.parse(localStorage.getItem('cart')) || {}; if (cart[id]) { cart[id].qty++; } else { const product = products.find(p => p.id === id); cart[id] = { product, qty: 1 }; } localStorage.setItem('cart', JSON.stringify(cart)); updateCartCount(); renderCart(); checkStock(id); } function removeFromCart(id) { const cart = JSON.parse(localStorage.getItem('cart')) || {}; delete cart[id]; localStorage.setItem('cart', JSON.stringify(cart)); updateCartCount(); renderCart(); } function updateQty(id, delta) { const cart = JSON.parse(localStorage.getItem('cart')) || {}; if (cart[id]) { cart[id].qty += delta; if (cart[id].qty <= 0) { delete cart[id]; } } localStorage.setItem('cart', JSON.stringify(cart)); updateCartCount(); renderCart(); } function renderCart() { const cartItems = document.getElementById('cart-items'); cartItems.innerHTML = ''; const cart = JSON.parse(localStorage.getItem('cart')) || {}; Object.keys(cart).forEach(id => { const item = cart[id]; const cartItem = document.createElement('div'); cartItem.classList.add('cart-item'); cartItem.innerHTML = ` ${item.product.name}

${item.product.name}

Price: ${formatPrice(item.product.price)}

Qty: ${item.qty}

`; cartItems.appendChild(cartItem); }); const cartTotal = document.getElementById('cart-total'); const total = Object.keys(cart).reduce((acc, id) => { return acc + cart[id].product.price * cart[id].qty; }, 0); cartTotal.textContent = `Total: ${formatPrice(total)}`; } function toggleCart() { const cartOverlay = document.querySelector('.cart-overlay'); cartOverlay.classList.toggle('open'); } function whatsappCheckout() { const cart = JSON.parse(localStorage.getItem('cart')) || {}; const message = Object.keys(cart).map(id => { return `${cart[id].product.name} x${cart[id].qty}`; }).join('\n'); const total = Object.keys(cart).reduce((acc, id) => { return acc + cart[id].product.price * cart[id].qty; }, 0); message += `\nTotal: ${formatPrice(total)}`; window.open(`https://wa.me/27834474639?text=${encodeURIComponent(message)}`); } function checkStock(id) { const product = products.find(p => p.id === id); if (product.stock <= 3) { document.querySelector(`[data-id="${id}"]`).parentElement.querySelector('.stock').textContent = `Low Stock (${product.stock})`; } else if (product.stock === 0) { document.querySelector(`[data-id="${id}"]`).parentElement.querySelector('.stock').textContent = 'Out of Stock'; document.querySelector(`[data-id="${id}"]`).disabled = true; } product.stock--; } function updateCartCount() { const cartCount = document.getElementById('cart-count'); const cart = JSON.parse(localStorage.getItem('cart')) || {}; const count = Object.keys(cart).reduce((acc, id) => { return acc + cart[id].qty; }, 0); cartCount.textContent = count; } function heroCarousel() { const heroSlides = document.querySelectorAll('.hero-slide'); let currentSlide = 0; setInterval(() => { heroSlides[currentSlide].classList.remove('active'); currentSlide = (currentSlide + 1) % heroSlides.length; heroSlides[currentSlide].classList.add('active'); }, 5000); } function revealElements() { const revealElements = document.querySelectorAll('.reveal'); const observer = new IntersectionObserver((entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.classList.add('visible'); } }); }, { threshold: 0.5 }); revealElements.forEach((element) => { observer.observe(element); }); } function toggleMenu() { const hamburger = document.querySelector('.hamburger'); const navLinks = document.getElementById('nav-links'); hamburger.classList.toggle('active'); navLinks.classList.toggle('active'); } function showToast(msg) { const toast = document.getElementById('toast'); toast.textContent = msg; toast.classList.add('visible'); setTimeout(() => { toast.classList.remove('visible'); }, 2000); } document.addEventListener('DOMContentLoaded', () => { renderProducts(); heroCarousel(); revealElements(); updateCartCount(); renderCart(); }); document.addEventListener('scroll', () => { const nav = document.getElementById('nav'); if (window.scrollY > 0) { nav.classList.add('scrolled'); } else { nav.classList.remove('scrolled'); } }); document.addEventListener('click', (e) => { if (e.target.classList.contains('add-to-cart')) { addToCart(e.target.dataset.id); } else if (e.target.classList.contains('remove-from-cart')) { removeFromCart(e.target.dataset.id); } else if (e.target.classList.contains('qty-minus')) { updateQty(e.target.dataset.id, -1); } else if (e.target.classList.contains('qty-plus')) { updateQty(e.target.dataset.id, 1); } else if (e.target.id === 'checkout-btn') { whatsappCheckout(); } else if (e.target.classList.contains('hamburger')) { toggleMenu(); } });