Apparel

Apparel


// Wait for the document to fully load document.addEventListener('DOMContentLoaded', function() { // Get all product options const productOptions = document.querySelectorAll('.product-option-select'); // Function to remove an option by value function removeOption(selectElement, optionValue) { for (let i = 0; i < selectElement.options.length; i++) { if (selectElement.options[i].value === optionValue) { selectElement.remove(i); break; } } } // Check if the order was successful if (typeof window.Squarespace === 'object' && window.Squarespace.onOrderComplete) { window.Squarespace.onOrderComplete(function(order) { // Loop through purchased items order.lineItems.forEach(function(item) { // Find the corresponding product option element const optionElement = document.querySelector(`.product-option-select[data-item-id="${item.id}"]`); if (optionElement) { // Remove the purchased option removeOption(optionElement, item.variantId); } }); }); } });