• 3-5 dages levering
  • PRISGARANTI
  • 3-5 dages levering
0,00 kr. 0

Kurv

Ingen varer i kurven.

  • OBS. Vi er ved at videreudvikle på den nye webshop - Ring hvis i har spørgsmål

Log ind

Opret en kundekonto

Ansøg om forhandler-konto

Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our Politik for personoplysninger.

Kontakt

Hurtigskift.dk ApS
Industrivej 12, 7430 Ikast, Denmark
CVR: 44549832
Bank detaljer:
Reg nummer: 5958
Kontonummer: 0002016198
(function () { function initVariationSwatches(scope) { const forms = (scope || document).querySelectorAll('form.variations_form'); forms.forEach(form => { const variationTable = form.querySelector('table.variations'); if (!variationTable) return; // Find alle variation selects const selects = variationTable.querySelectorAll('select'); selects.forEach(select => { // Undgå dobbelt-init if (select.dataset.wgSwatchesInit === '1') return; select.dataset.wgSwatchesInit = '1'; // Skjul select visuelt (men behold den funktionelt) select.style.position = 'absolute'; select.style.left = '-9999px'; select.style.width = '1px'; select.style.height = '1px'; select.style.opacity = '0'; // Container til swatches const swatchWrap = document.createElement('div'); swatchWrap.className = 'wg-swatches'; swatchWrap.setAttribute('role', 'radiogroup'); swatchWrap.dataset.forAttribute = select.name || ''; // Byg swatches ud fra options const options = Array.from(select.options || []); options.forEach(opt => { // Skip placeholder som "Vælg..." if (!opt.value) return; const btn = document.createElement('button'); btn.type = 'button'; btn.className = 'wg-swatch'; btn.setAttribute('role', 'radio'); btn.setAttribute('aria-checked', 'false'); btn.dataset.value = opt.value; const span = document.createElement('span'); span.className = 'wg-swatch-label'; span.textContent = opt.textContent.trim(); btn.appendChild(span); // Disabled hvis option er disabled if (opt.disabled) { btn.classList.add('is-disabled'); btn.setAttribute('aria-disabled', 'true'); } btn.addEventListener('click', () => { if (btn.classList.contains('is-disabled')) return; // Sæt select value + trig change så Woo opdaterer variation select.value = opt.value; select.dispatchEvent(new Event('change', { bubbles: true })); // Marker selected i UI syncSelected(select, swatchWrap); }); swatchWrap.appendChild(btn); }); // Indsæt swatches i samme række (efter select) // Woo structure: ... select ... const valueCell = select.closest('td.value') || select.parentElement; if (valueCell) valueCell.appendChild(swatchWrap); // Sync initial valgt syncSelected(select, swatchWrap); // Når Woo ændrer availability (disabled options), sync disabled + selection select.addEventListener('change', () => { syncDisabled(select, swatchWrap); syncSelected(select, swatchWrap); }); // Når man klikker "Nulstil"/reset variations form.addEventListener('reset_data', () => { // Woo triggerer ofte custom events; vi sync’er bare efter en tick setTimeout(() => { syncDisabled(select, swatchWrap); syncSelected(select, swatchWrap); }, 0); }); // Fallback: observer DOM ændringer (Woo kan disable options dynamisk) const mo = new MutationObserver(() => { syncDisabled(select, swatchWrap); syncSelected(select, swatchWrap); }); mo.observe(select, { attributes: true, childList: true, subtree: true }); }); }); } function syncSelected(select, wrap) { const val = select.value; wrap.querySelectorAll('.wg-swatch').forEach(b => { const isSelected = b.dataset.value === val; b.classList.toggle('is-selected', isSelected); b.setAttribute('aria-checked', isSelected ? 'true' : 'false'); }); } function syncDisabled(select, wrap) { const map = new Map(); Array.from(select.options || []).forEach(opt => { if (!opt.value) return; map.set(opt.value, !!opt.disabled); }); wrap.querySelectorAll('.wg-swatch').forEach(b => { const disabled = map.get(b.dataset.value) === true; b.classList.toggle('is-disabled', disabled); b.setAttribute('aria-disabled', disabled ? 'true' : 'false'); }); } // Init on load document.addEventListener('DOMContentLoaded', () => initVariationSwatches(document)); // Hvis Breakdance/woo loader via AJAX/quickview: kald init igen efter behov document.addEventListener('wg_swatches_reinit', () => initVariationSwatches(document)); })();