Mon conseiller peintureQuitter le conseiller

Le conseil de nos magasins, directement chez vous.

Ces conseils, ce sont ceux de nos équipes en magasin : les mêmes questions, les mêmes astuces et la même envie de vous voir réussir. Parlez-nous de votre projet, on vous guide pas à pas.

Imaginé avec nos équipes magasins2 minutesUn projet réussi
Un magasin OZE et son mur de couleursEn magasin comme en ligne, le même conseil.
`; suivi('impression'); const w=window.open('','_blank'); if(!w){alert('Votre navigateur a bloqué la fenêtre. Autorisez les fenêtres pour imprimer votre estimation.');return;} w.document.open();w.document.write(html);w.document.close(); } function garder(f){const y=window.scrollY;f();brancher();sauver();window.scrollTo(0,y);} function panier(L,teintable,kit){ const b=document.getElementById('panier'); if(!L){b.classList.remove('vu');return;} const pris=L.filter(l=>l.on&&l.pots), accs=(kit||[]).filter(id=>accOn[id]), total=pris.reduce((t,l)=>t+l.pots.prix,0)+accs.reduce((t,id)=>t+(+ACC[id][1]),0), nb=pris.reduce((t,l)=>t+l.pots.detail.reduce((a,x)=>a+x.n,0),0); const cumul=total+panierExistant, pct=Math.min(100,Math.round(cumul/SEUIL_LIVRAISON*100)); document.getElementById('panierT').innerHTML=`${euro(total)} TTC${nb} pot${nb>1?'s':''}${accs.length?` + ${accs.length} outil${accs.length>1?'s':''}`:''}${cumul>=SEUIL_LIVRAISON?'Livraison offerte \u2713':`Plus que ${euro(SEUIL_LIVRAISON-cumul)} pour la livraison offerte`}${panierExistant>0?' (avec votre panier)':''}`; b.classList.add('vu'); const bt=document.getElementById('toutPanier'); bt.textContent=teintable&&!couleurChoisie?'Choisir ma couleur':'Tout ajouter au panier'; bt.onclick=()=>{ if(teintable&&!couleurChoisie){document.querySelector('#ozc .familles').scrollIntoView({behavior:'smooth',block:'center'});return;} suivi('ajout_panier',{valeur:Math.round(total*100)/100,projet:S.objet});ajouterAuPanier(pris,bt,accs); }; const lib=teintable&&!couleurChoisie?'Choisissez d\u2019abord votre couleur':`Ajouter mon projet au panier \u00b7 ${euro(total)}`; E.querySelectorAll('[data-panier]').forEach(x=>{x.textContent=lib;x.onclick=bt.onclick;}); E.querySelectorAll('[data-panier-t]').forEach(x=>{x.textContent=`${nb} pot${nb>1?'s':''}${accs.length?` + ${accs.length} outil${accs.length>1?'s':''}`:''} \u00b7 ${cumul>=SEUIL_LIVRAISON?'livraison offerte':'retrait gratuit en magasin'}`;}); } /* Ajout réel au panier (WooCommerce Store API, même site) */ async function ajouterAuPanier(pris,btn,accs){ const ASP={MAT:'mat',VEL:'velours',SAT:'satin',VERN:'satin'}; btn.disabled=true; const t0=btn.textContent; btn.textContent='Ajout en cours…'; try{ const c=await fetch('/wp-json/wc/store/v1/cart',{credentials:'same-origin'}); const nonce=c.headers.get('Nonce'); for(const l of pris){ const url=urlProduit(l.k); const slug=url.split('/produit/')[1].replace(/\/$/,''); const pr=(await (await fetch('/wp-json/wc/store/v1/products?slug='+encodeURIComponent(slug))).json())[0]; if(!pr) throw new Error('produit'); for(const x of l.pots.detail){ const v=(pr.variations||[]).find(va=>{ const vals=va.attributes.map(a=>String(a.value).toLowerCase()); const okVol=vals.some(s=>parseFloat(s.replace('-','.'))===x.v&&/^\d/.test(s)); const okAsp=!ASP[l.k]||vals.some(s=>s.startsWith(ASP[l.k])); return okVol&&okAsp;}); if(!v) throw new Error('format'); const r=await fetch('/wp-json/wc/store/v1/cart/add-item',{method:'POST',credentials:'same-origin',headers:{'Content-Type':'application/json','Nonce':nonce},body:JSON.stringify({id:v.id,quantity:x.n})}); if(!r.ok) throw new Error('ajout'); } } for(const id of (accs||[])){ const r=await fetch('/wp-json/wc/store/v1/cart/add-item',{method:'POST',credentials:'same-origin',headers:{'Content-Type':'application/json','Nonce':nonce},body:JSON.stringify({id:+id,quantity:1})}); if(!r.ok) throw new Error('accessoire'); } btn.disabled=false; btn.textContent=t0; try{window.jQuery&&jQuery(document.body).trigger('wc_fragment_refresh');}catch(e){} await lirePanier(); confirmationPanier(); }catch(e){ btn.disabled=false; btn.textContent=t0; alert('Oups, un produit n’a pas pu être ajouté. Ouvrez les fiches une par une, ou appelez votre magasin OZE.'); } } function confirmationPanier(){ const z=document.getElementById('ozc')||document.body; const f=document.createElement('div');f.className='fenetre'; const reste=SEUIL_LIVRAISON-panierExistant; f.innerHTML=`

C’est dans votre panier \u2713

Votre projet ${esc(String(S.objet||'').toLowerCase())} est ajouté. Total de votre panier : ${euro(panierExistant)}${reste<=0?' · livraison offerte \u2713':` · plus que ${euro(reste)} pour la livraison offerte`}. Retrait gratuit à Redon et Bellevigny.

Voir mon panier et commanderContinuer mes achats
`; z.appendChild(f); f.querySelector('#fermerConf').onclick=()=>f.remove(); f.onclick=e=>{if(e.target===f) f.remove();}; f.querySelector('#autreProjet').onclick=()=>{f.remove();suivi('nouveau_projet');const r=document.getElementById('raz');if(r) r.click();(document.getElementById('ozc')||document.body).scrollIntoView({behavior:'smooth'});}; } function brancher(){ E.querySelectorAll('[data-fil]').forEach(b=>b.onclick=()=>aller(b.dataset.fil)); const r=document.getElementById('ret'); if(r) r.onclick=retour; const z=document.getElementById('raz'); if(z) z.onclick=()=>{Object.keys(S).forEach(k=>delete S[k]);S.hist=[];S.surf=0;S.ecran='ou';couleurChoisie=null;famille='Toutes';exclus={};accOn={};qtes={};try{sessionStorage.removeItem('ozc')}catch(e){}rendre();window.scrollTo(0,0);}; } const E=document.getElementById('ecran'); function rendre(){ if(S.ecran!=='resultat') panier(null); if(S.ecran==='surface') ecranSurface(); else if(S.ecran==='resultat') ecranResultat(); else ecranQuestion(S.ecran); progression(); brancher(); sauver(); } /* Lien direct depuis l'accueil : /conseiller/#mur, #plafond, #facade, #meuble, #volets, #radiateur */ const DIRECT={mur:["Int\u00e9rieur","Mur"],plafond:["Int\u00e9rieur","Plafond"],facade:["Ext\u00e9rieur","Fa\u00e7ade"],meuble:["Int\u00e9rieur","Meuble"],volets:["Ext\u00e9rieur","Volets"],radiateur:["Int\u00e9rieur","Radiateur"]}; function sauver(){try{sessionStorage.setItem('ozc',JSON.stringify({u:location.pathname+location.search+location.hash,S:S,c:couleurChoisie&&couleurChoisie.n,a:accOn,x:exclus,f:famille,q:qtes,cl:client}));}catch(e){}} let restaure=false; try{const sv=JSON.parse(sessionStorage.getItem('ozc')||'null');if(sv&&sv.S&&sv.u===location.pathname+location.search+location.hash&&sv.S.ecran!=='ou'){Object.assign(S,sv.S);couleurChoisie=COLS.find(c=>c.n===sv.c)||null;accOn=sv.a||{};exclus=sv.x||{};famille=sv.f||'Toutes';qtes=sv.q||{};client=sv.cl||{};restaure=true;}}catch(e){} const dl=restaure?null:DIRECT[(location.hash||'').slice(1)]; const q=new URLSearchParams(location.search); const cq=restaure?null:q.get('couleur'); if(cq){couleurChoisie=COLS.find(c=>slugN(c.n)===cq)||null;} const TYPE_FICHE={INT:["Int\u00e9rieur",null],FAC:["Ext\u00e9rieur","Fa\u00e7ade"],LMEU:["Int\u00e9rieur","Meuble"],LBOIS:["Ext\u00e9rieur",null]}; const tf=restaure?null:TYPE_FICHE[q.get('type')]; if(dl){poser('ou',dl[0]);poser('objet',dl[1]);S.hist=['ou','objet'];S.ecran=prochaine();} else if(tf){poser('ou',tf[0]);S.hist=['ou'];if(tf[1]){poser('objet',tf[1]);S.hist.push('objet');}S.ecran=prochaine();} chargerPrix(); rendre(); }