Menu
EUR
Vergelijk producten
Selecteer 2 of meer producten om te vergelijken.

Klik hier om verder te winkelen..
Bankoverschrijving
Kies uw taal
Kies uw valuta

Mijn account

Wachtwoord vergeten?

Recent toegevoegd

Totaal incl. btw
€0,00
Bestel nog voor €700,00 en de verzending is gratis
0
Vergelijk
Start vergelijking

Dit artikel is toegevoegd aan uw winkel wagen!
(function () { const API_BASE = "https://hd-spijlen.michel-abchekwerk.workers.dev"; const TARGET_SLUG = "/spijlendirect-compleet-pakket"; if (!location.pathname.includes(TARGET_SLUG)) return; console.log("[HD] init configurator", location.pathname); function hideBuyBox() { // 1) verberg sticky add-to-cart als die bestaat const sticky = document.querySelector("#addtocart-sticky, .addtocart-sticky, .add-to-cart-sticky"); if (sticky) sticky.style.display = "none"; // 2) zoek de button (groene) en verberg de hele container eromheen const btn = document.querySelector('button[type="submit"], input[type="submit"]'); if (btn) { const wrap = btn.closest(".product__actions, .product-actions, .product__form, .product-form, .buybox, .buy-box, .buy, .product__buy, .productbuy, .col-buy, .right, .product__info") || btn.closest("form") || btn.parentElement; if (wrap) { wrap.style.display = "none"; wrap.setAttribute("data-hd-hidden", "1"); } } // 3) extra safety: verberg variant “Maak een keuze” dropdown-block als die los staat const label = Array.from(document.querySelectorAll("label, .label, .form__label")) .find(el => (el.textContent || "").toLowerCase().includes("maak een keuze")); if (label) { const block = label.closest(".form-group, .product__options, .product-options, .option, .row, .field") || label.parentElement; if (block) block.style.display = "none"; } } // blijft verbergen als LS opnieuw rendert const mo = new MutationObserver(() => hideBuyBox()); mo.observe(document.documentElement, { childList: true, subtree: true }); function ready(fn) { if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", fn); else fn(); } ready(async () => { hideBuyBox(); const mount = document.getElementById("hd-configurator"); if (!mount) { console.warn("[HD] #hd-configurator niet gevonden. Zet
in productomschrijving."); return; } const DEFAULTS = { soortSpijlen: "Spijlen 25x25 vlak", hoeken: "0", muuraansluiting: "Geen", soortPalen: "Grondpalen", soortPaaldop: "Paalkap kunststof", }; const fmtEUR = (n) => new Intl.NumberFormat("nl-NL", { style: "currency", currency: "EUR" }).format(n); function getVatPref() { try { const v = localStorage.getItem("vat_type_pref") || ""; if (/excl/i.test(v)) return "excl"; if (/incl/i.test(v)) return "incl"; } catch {} return "incl"; } function roundingNote(m) { if (!isFinite(m) || m <= 0) return ""; const vakken = Math.ceil(m / 2.2); return `Wordt afgerond naar ${vakken} vak(ken) = ${(vakken * 2.2).toFixed(1).replace(".", ",")}m`; } // opties ophalen const opt = await fetch(API_BASE + "/api/options").then(r => r.json()).catch(e => ({ ok:false, error:String(e) })); if (!opt.ok) { mount.innerHTML = `
Configurator error: ${opt.error || "options niet geladen"}
`; return; } const kleuren = (opt.options.kleuren || []).filter(k => /7016|9005/.test(k)); const hoogtes = opt.options.hoogtes || []; // UI mount.innerHTML = `

Configureer je spijlenpakket

`; const elKleur = mount.querySelector("#hd-kleur"); const elHoogte = mount.querySelector("#hd-hoogte"); const elLengte = mount.querySelector("#hd-lengte"); const elRound = mount.querySelector("#hd-round"); const elBtn = mount.querySelector("#hd-calc"); const elPrice = mount.querySelector("#hd-price"); kleuren.forEach(k => elKleur.add(new Option(k, k))); hoogtes.forEach(h => elHoogte.add(new Option(h, h))); elLengte.oninput = () => { elRound.textContent = roundingNote(Number(elLengte.value)); }; elRound.textContent = roundingNote(10); async function quote() { elBtn.disabled = true; const cfg = { ...DEFAULTS, kleur: elKleur.value, hoogte: elHoogte.value, lengthM: Number(elLengte.value), }; const res = await fetch(API_BASE + "/api/quote", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ config: cfg }), }).then(r => r.json()).catch(e => ({ ok:false, error:String(e) })); elBtn.disabled = false; if (!res.ok) { elPrice.textContent = "Prijs ophalen mislukt: " + (res.error || "onbekend"); return; } const pref = getVatPref(); const main = pref === "excl" ? res.totalExcl : res.totalIncl; elPrice.innerHTML = `
${fmtEUR(main)}
Incl. ${fmtEUR(res.totalIncl)} · Excl. ${fmtEUR(res.totalExcl)} · ${res.lengthLabel}
`; } elBtn.onclick = quote; quote(); // nogmaals verbergen na injectie (zekerheid) hideBuyBox(); }); })();