Express Purchase Notice

Express One-Time Purchase Only

This website is designed for express one-time purchases. If you are looking to make multiple purchases, please click the link below.

Click Here for Multiple Purchases
T-shirt Icon

CIU 2024 Commencement T-shirt

$25

Travel Mug Icon

CIU 2024 Commencement Travel Mug

$25

Travel Mug Icon

CIU 2024 Commencement Mug

$15

Insulated Cup Icon

CIU 2024 Commencement Insulated Cup

$15

Graduation Stole Icon

CIU 2024 Commencement Stole

$30

CIU Pin Icon

CIU 2024 Commencement Pin

$10

Power Bank Icon

CIU 2024 Commencement Power Bank

$20

Lanyard Icon

CIU 2024 Commencement Lanyard

$3

Sticker Icon

CIU 2024 Commencement Sticker

$1

document.addEventListener('DOMContentLoaded', function() { // Initialize Stripe with your publishable API key var stripe = Stripe('pk_live_51IGXSbFRS7ITcFQRVhcFQEF3hbplVMtZbonahERTJzyGdonSqnbBPQEwZ6ixuo4SSEWFPUtFq2O8HEBUdoos5nQ800aKBiM17C'); // Array to store cart items let cart = []; // Function to add an item to the cart function addToCart(productName, price) { const cartItem = { name: productName, price: parseFloat(price) }; // Add the item to the cart array cart.push(cartItem); updateCart(); // Update the cart display after adding an item } // Function to update the cart display function updateCart() { const cartItemsContainer = document.getElementById('cart-items'); const cartTotalElement = document.getElementById('cart-total'); let total = 0; // Clear the current cart display cartItemsContainer.innerHTML = ''; // Loop through each cart item and display it cart.forEach(item => { total += item.price; // Create the HTML for the cart item const cartItemElement = document.createElement('li'); cartItemElement.innerHTML = `${item.name} - $${item.price.toFixed(2)}`; cartItemsContainer.appendChild(cartItemElement); }); // Update the total price in the cart cartTotalElement.innerText = total.toFixed(2); } // Event listener for the Add to Cart buttons const cartButtons = document.querySelectorAll('.cart-button'); cartButtons.forEach(button => { button.addEventListener('click', function(event) { event.preventDefault(); const productName = button.getAttribute('data-product-name'); const productPrice = button.getAttribute('data-product-price'); addToCart(productName, productPrice); }); }); // Event listener for the Checkout button document.getElementById('checkout-button').addEventListener('click', function() { if (cart.length === 0) { alert('Your cart is empty!'); return; } let totalAmount = cart.reduce((sum, item) => sum + item.price, 0) * 100; // Convert total to cents fetch('/wp-json/stripe/v1/create-checkout-session', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ amount: totalAmount, currency: 'usd', items: cart.map(item => ({ name: item.name, price: item.price })) }), }) .then(response => response.json()) .then(session => stripe.redirectToCheckout({ sessionId: session.id })) .catch(error => console.error('Error:', error)); }); // Event listener for the Clear Cart button document.getElementById('clear-cart-button').addEventListener('click', function() { cart = []; // Clear the cart array updateCart(); // Update the cart display }); });
;