, DOM is ready) initAccordion(document); initSizeGuide(document); // If your theme swaps sections with AJAX (e.g., theme editor), // re-init when Shopify renders a section. document.addEventListener('shopify:section:load', function(e){ var container = e.target || e.detail?.section; initAccordion(container); initSizeGuide(container); }); })();