document.addEventListener('DOMContentLoaded', function() { const productJson = document.querySelectorAll('[id^=ProductJson-'); if (productJson.length > 0) { for (let i = 0; i < productJson.length; i++) { const current = productJson[i]; const sectionId = current.id.replace('ProductJson-', ''); const section = document.querySelector('[data-section-id="' + sectionId + '"]'); const product = JSON.parse(current.text); if (product.options.length === 1) { const unavailableVariants = []; for (let j = 0; j < product.variants.length; j++) { const variant = product.variants[j]; if (!variant.available) { unavailableVariants.push(variant); } }