313 What Up Dough Cookies
`; }).join(”); return `
${cookie.name}

${cookie.name}

${cookie.description}

${quantityOptionsHtml}
`; }).join(”); } /** * Renders the dynamic content for the cart page. */ function renderCartPage() { const cartItemsContainer = document.getElementById(‘cart-items-container’); const cartTotalsContainer = document.getElementById(‘cart-totals-container’); const cartEmptyMessage = document.getElementById(‘cart-empty-message’); if (!cartItemsContainer || !cartTotalsContainer || !cartEmptyMessage) return; if (cart.length === 0) { cartEmptyMessage.classList.remove(‘hidden’); cartItemsContainer.innerHTML = ”; cartTotalsContainer.innerHTML = ”; return; } cartEmptyMessage.classList.add(‘hidden’); // — Render Items — cartItemsContainer.innerHTML = cart.map(item => `
${item.name}

${item.name}

$${item.price.toFixed(2)} per pack

${item.quantity}

$${(item.price * item.quantity).toFixed(2)}

`).join(”); // — Calculate and Render Totals — const subtotal = cart.reduce((sum, item) => sum + (item.price * item.quantity), 0); const taxRate = 0.06; // Example 6% sales tax const shipping = subtotal > 50 ? 0.00 : 7.00; const tax = subtotal * taxRate; const total = subtotal + tax + shipping; cartTotalsContainer.innerHTML = `
Subtotal: $${subtotal.toFixed(2)}
Shipping: ${shipping === 0.00 ? ‘FREE’ : `$${shipping.toFixed(2)}`}
Tax (6%): $${tax.toFixed(2)}
Order Total: $${total.toFixed(2)}
`; } /** * Updates the quantity of a specific item in the cart. * @param {string} itemId – The ID of the cart item. * @param {number} change – The amount to change the quantity by (+1 or -1). */ function updateCartItemQuantity(itemId, change) { const itemIndex = cart.findIndex(item => item.id === itemId); if (itemIndex > -1) { cart[itemIndex].quantity += change; if (cart[itemIndex].quantity item.id !== itemId); saveCart(); renderCartPage(); showToast(‘Item Removed’, ‘The item was successfully removed from your cart.’, ‘bg-red-500’); } /** * Simulates the PayPal checkout process by showing a modal. * @param {string} total – The total amount due. */ function simulateCheckout(total) { if (cart.length === 0) { showToast(‘Cart is Empty’, ‘Please add cookies before checking out.’, ‘bg-yellow-500’); return; } const checkoutModal = document.getElementById(‘checkout-modal’); const modalTotal = document.getElementById(‘modal-total-amount’); const modalItems = document.getElementById(‘modal-items-list’); modalTotal.textContent = `$${total}`; modalItems.innerHTML = cart.map(item => `
  • ${item.quantity} x ${item.name} $${(item.price * item.quantity).toFixed(2)}
  • `).join(”); checkoutModal.style.display = ‘flex’; } /** * Finalizes the simulated payment and clears the cart. */ function finalizePayment() { // Simulate API call to PayPal setTimeout(() => { cart = []; saveCart(); closeModal(); showToast(‘Payment Successful!’, ‘Thank you for ordering your 313 What Up Dough Cookies!’, ‘bg-green-600’, 5000); navigate(‘home’); }, 1000); } /** * Closes the currently active modal. */ function closeModal() { document.getElementById(‘checkout-modal’).style.display = ‘none’; } /** * Displays a temporary toast notification. * @param {string} title – The title of the toast. * @param {string} message – The message body. * @param {string} bgColor – Tailwind background color class (default bg-violet-600). * @param {number} duration – How long to display in ms (default 3000). */ function showToast(title, message, bgColor = ‘bg-violet-600’, duration = 3000) { const toast = document.getElementById(‘toast-notification’); if (!toast) return; toast.innerHTML = `
    ${title}
    ${message}
    `; toast.className = `fixed bottom-5 right-5 p-4 rounded-xl shadow-2xl text-white transition-all duration-300 transform translate-y-0 opacity-100 ${bgColor}`; setTimeout(() => { toast.classList.add(‘translate-y-20’, ‘opacity-0’); }, duration); } // Initialization on page load window.onload = () => { navigate(‘home’); // Start on the home page updateCartCount(); // Initial cart count };
    313 WHAT UP DOUGH

    DETROIT’S BEST DOUGH.

    The 313 story: From a single secret recipe to the Motor City’s favorite bite. Made with local love, baked with soul.

    The 313 Difference

    Close-up of a warm cookie

    What Up Dough? It’s a Movement.

    Our journey started in a small Detroit kitchen, fueled by a passion for the perfect chew and a desire to spread joy. ‘313 What Up Dough’ isn’t just a name; it’s a greeting, a question, and an invitation to taste the city’s spirit in every bite. We pride ourselves on using high-quality ingredients, from local butter to premium chocolate, ensuring every cookie is a masterpiece.

    “The secret to the dough is simple: it’s love, high standards, and a little bit of Detroit grit.”

    Don’t Miss Our Signature Chocolate Chip

    It’s the recipe that started it all. If you only try one, make it this one.

    Award Winning Taste

    Ships Nationwide

    Baked Fresh Daily

    313 WHAT UP DOUGH COOKIES

    © 2025 313 What Up Dough Cookies. All rights reserved.