document.addEventListener('DOMContentLoaded', function () { const NUM = v => String(v||'').replace(/\s+/g,'').replace(',', '.').trim(); function bindDimSet(form, selName, otherName, wrapSelector, hiddenSelector){ const sel = form.querySelector(`select[name="${selName}"]`); const other = form.querySelector(`input[name="${otherName}"]`); const wrap = form.querySelector(wrapSelector); const hidden = form.querySelector(hiddenSelector); if(!sel || !other || !wrap || !hidden) return; const isOther = () => { const v = (sel.value||'').toLowerCase().trim(); const t = sel.options[sel.selectedIndex]?.text?.toLowerCase() || ''; return v === 'other' || /rozwiązanie\s*niestandardowe/.test(t); }; function sync(){ if(isOther()){ wrap.style.display = ''; other.required = true; hidden.value = NUM(other.value); }else{ wrap.style.display = 'none'; other.required = false; other.value = ''; hidden.value = NUM(sel.value); } } sel.addEventListener('change', sync); other.addEventListener('input', sync); sync(); } function bindForm(form){ if (form.dataset.ppBound) return; form.dataset.ppBound = '1'; // LP (bez prefixu) bindDimSet(form,'width_sel', 'width_other', '.pp-width-other', 'input[name="your-szerokosc-2"]'); bindDimSet(form,'length_sel', 'length_other', '.pp-length-other', 'input[name="your-dlugosc-2"]'); bindDimSet(form,'height_sel', 'height_other', '.pp-height-other', 'input[name="your-wysokosc-2"]'); // SIDEBAR (prefix sb_) bindDimSet(form,'sb_width_sel', 'sb_width_other', '.pp-width-other', '#sb-your-szerokosc-2'); bindDimSet(form,'sb_length_sel', 'sb_length_other', '.pp-length-other', '#sb-your-dlugosc-2'); bindDimSet(form,'sb_height_sel', 'sb_height_other', '.pp-height-other', '#sb-your-wysokosc-2'); // walidacja finalnych hiddenów form.addEventListener('wpcf7beforesubmit', function(e){ const finals = [ form.querySelector('input[name="your-szerokosc-2"]') || form.querySelector('#sb-your-szerokosc-2'), form.querySelector('input[name="your-dlugosc-2"]') || form.querySelector('#sb-your-dlugosc-2'), form.querySelector('input[name="your-wysokosc-2"]') || form.querySelector('#sb-your-wysokosc-2') ].filter(Boolean); ['width_sel','length_sel','height_sel','sb_width_sel','sb_length_sel','sb_height_sel'].forEach(n=>{ const el = form.querySelector(`select[name="${n}"]`); if(el) el.dispatchEvent(new Event('change')); }); const bad = finals.filter(el => !/^(\d+(\.\d+)?)$/.test((el.value||'').trim())); if (bad.length){ e.preventDefault(); alert('Podaj poprawne wymiary (np. 20 lub 23.5).'); } }); } document.querySelectorAll('.wpcf7 form').forEach(bindForm); const obs = new MutationObserver(() => { document.querySelectorAll('.wpcf7 form').forEach(bindForm); }); obs.observe(document.body, {childList:true, subtree:true}); });

Pour faciliter l’estimation d’un produit personnalisé pour une solution spécifique, nous avons créé le configurateur POLPLAN.
Grâce à lui, vous pouvez configurer votre commande facilement et intuitivement, ce qui nous permet d’en estimer le coût avec plus de précision. Aucune compétence avancée n’est requise, le configurateur est simple d’utilisation.
Écrivez-nous
Nous répondrons et préparerons un devis détaillé pour vous dans un maximum de 3 jours ouvrables.