//20200923 rajout popup pointure function checkPointureHeader(ReferenceGroupee,idImage,pointure1,pointure2,pointure3,pointure4,pointure5,pointure6,pointure7,pointure8,pointure9,pointure10) { var coeur = document.getElementById("coeur_"+idImage); var coeurEtat = coeur.getAttribute("src"); if (coeurEtat == "/images/coeur_plein.png") { coeur.setAttribute("src", "/images/coeur_vide.png"); //sauvegarde des like sur la session sessionStorage.setItem("coeur_"+idImage, 0); deletePanier(ReferenceGroupee+"35"); deletePanier(ReferenceGroupee+"35.5"); deletePanier(ReferenceGroupee+"36"); deletePanier(ReferenceGroupee+"36.5"); deletePanier(ReferenceGroupee+"37"); deletePanier(ReferenceGroupee+"37.5"); deletePanier(ReferenceGroupee+"38"); deletePanier(ReferenceGroupee+"38.5"); deletePanier(ReferenceGroupee+"39"); deletePanier(ReferenceGroupee+"39.5"); deletePanier(ReferenceGroupee+"40"); deletePanier(ReferenceGroupee+"40.5"); deletePanier(ReferenceGroupee+"41"); deletePanier(ReferenceGroupee+"41.5"); deletePanier(ReferenceGroupee+"42"); deletePanier(ReferenceGroupee+"42.5"); } else { coeur.setAttribute("src", "/images/coeur_plein.png"); //sauvegarde des like sur la session sessionStorage.setItem("coeur_"+idImage, 1); $( "#dialog-modalPointure" ).dialog({ autoOpen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 } }); $( "#dialog-modalPointure" ).dialog( "open" ); // Obtenir une référence à l'élément dans lequel nous voulons insérer un nouveau noeud var parentElement = document.getElementById('taillePopup'); if (pointure1 != ''){ // Créer un nouvel élément var newElement1 = document.createElement("a"); newElement1.setAttribute("id","pointure1"); newElement1.setAttribute("href","javascript:void(0)"); newElement1.setAttribute("rel",pointure1); //newElement1.setAttribute("class","bloctaille"); newElement1.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure1+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent1 = document.createTextNode(pointure1); // ajoute le nœud texte au nouveau div créé newElement1.appendChild(newContent1); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement1, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure2 != ''){ var newElement2 = document.createElement("a"); newElement2.setAttribute("href","javascript:void(0)"); newElement2.setAttribute("rel",pointure2); newElement2.setAttribute("id","pointure2"); newElement2.setAttribute("class","bloctaille"); newElement2.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure2+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent2 = document.createTextNode(pointure2); // ajoute le nœud texte au nouveau div créé newElement2.appendChild(newContent2); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement2, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure3 != ''){ var newElement3 = document.createElement("a"); newElement3.setAttribute("href","javascript:void(0)"); newElement3.setAttribute("rel",pointure3); newElement3.setAttribute("id","pointure3"); newElement3.setAttribute("class","bloctaille"); newElement3.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure3+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent3 = document.createTextNode(pointure3); // ajoute le nœud texte au nouveau div créé newElement3.appendChild(newContent3); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement3, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure4 != ''){ var newElement4 = document.createElement("a"); newElement4.setAttribute("href","javascript:void(0)"); newElement4.setAttribute("rel",pointure4); newElement4.setAttribute("id","pointure4"); newElement4.setAttribute("class","bloctaille"); newElement4.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure4+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent4 = document.createTextNode(pointure4); // ajoute le nœud texte au nouveau div créé newElement4.appendChild(newContent4); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement4, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure5 != ''){ var newElement5 = document.createElement("a"); newElement5.setAttribute("href","javascript:void(0)"); newElement5.setAttribute("rel",pointure5); newElement5.setAttribute("id","pointure5"); newElement5.setAttribute("class","bloctaille"); newElement5.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure5+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent5 = document.createTextNode(pointure5); // ajoute le nœud texte au nouveau div créé newElement5.appendChild(newContent5); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement5, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure6 != ''){ var newElement6 = document.createElement("a"); newElement6.setAttribute("href","javascript:void(0)"); newElement6.setAttribute("rel",pointure6); newElement6.setAttribute("id","pointure6"); newElement6.setAttribute("class","bloctaille"); newElement6.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure6+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent6 = document.createTextNode(pointure6); // ajoute le nœud texte au nouveau div créé newElement6.appendChild(newContent6); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement6, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure7 != ''){ var newElement7 = document.createElement("a"); newElement7.setAttribute("href","javascript:void(0)"); newElement7.setAttribute("rel",pointure7); newElement7.setAttribute("id","pointure7"); newElement7.setAttribute("class","bloctaille"); newElement7.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure7+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent7 = document.createTextNode(pointure7); // ajoute le nœud texte au nouveau div créé newElement7.appendChild(newContent7); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement7, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure8 != ''){ var newElement8 = document.createElement("a"); newElement8.setAttribute("href","javascript:void(0)"); newElement8.setAttribute("rel",pointure8); newElement8.setAttribute("id","pointure8"); newElement8.setAttribute("class","bloctaille"); newElement8.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure8+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent8 = document.createTextNode(pointure8); // ajoute le nœud texte au nouveau div créé newElement8.appendChild(newContent8); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement8, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure9 != ''){ var newElement9 = document.createElement("a"); newElement9.setAttribute("href","javascript:void(0)"); newElement9.setAttribute("rel",pointure9); newElement9.setAttribute("id","pointure9"); newElement9.setAttribute("class","bloctaille"); newElement9.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure9+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent9 = document.createTextNode(pointure9); // ajoute le nœud texte au nouveau div créé newElement9.appendChild(newContent9); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement9, null); //setTimeout(document.location="/en/commande/achat.html",4000); } if (pointure10 != ''){ var newElement10 = document.createElement("a"); newElement10.setAttribute("href","javascript:void(0)"); newElement10.setAttribute("rel",pointure10); newElement10.setAttribute("id","pointure10"); newElement10.setAttribute("class","bloctaille"); newElement10.setAttribute("onclick","addPanier('"+ReferenceGroupee+"','"+pointure10+"','1');closePointurePopup();return checkAuth(this)"); // et lui donne un peu de contenu var newContent10 = document.createTextNode(pointure10); // ajoute le nœud texte au nouveau div créé newElement10.appendChild(newContent10); // Insérer le nouvel élément avant le premier enfant parentElement.insertBefore(newElement10, null); //setTimeout(document.location="/en/commande/achat.html",4000); } } return false; } function selectTaille(refgroupee,taille,IdPointure) { //var bouton = document.getElementById('pointure1'); //var colorbtn = bouton.getAttribute("background-color"); //bouton.setAttribute("background-color","black"); //bouton.setAttribute("color","white"); document.getElementById('select_taille').setAttribute("onclick","addPanier('"+refgroupee+"','"+taille+"','1');closePointurePopup();"); } function closePointurePopup() { var element1 = document.getElementById('pointure1'); if (typeof(element1) != 'undefined' && element1 != null) { element1.setAttribute("display", "none"); document.getElementById("pointure1").remove(); } var element2 = document.getElementById('pointure2'); if (typeof(element2) != 'undefined' && element2 != null) { element2.setAttribute("display", "none"); document.getElementById("pointure2").remove(); } var element3 = document.getElementById('pointure3'); if (typeof(element3) != 'undefined' && element3 != null) { element3.setAttribute("display", "none"); document.getElementById("pointure3").remove(); } var element4 = document.getElementById('pointure4'); if (typeof(element4) != 'undefined' && element4 != null) { element4.setAttribute("display", "none"); document.getElementById("pointure4").remove(); } var element5 = document.getElementById('pointure5'); if (typeof(element5) != 'undefined' && element5 != null) { element5.setAttribute("display", "none"); document.getElementById("pointure5").remove(); } var element6 = document.getElementById('pointure6'); if (typeof(element6) != 'undefined' && element6 != null) { element6.setAttribute("display", "none"); document.getElementById("pointure6").remove(); } var element7 = document.getElementById('pointure7'); if (typeof(element7) != 'undefined' && element7 != null) { element7.setAttribute("display", "none"); document.getElementById("pointure7").remove(); } var element8 = document.getElementById('pointure8'); if (typeof(element8) != 'undefined' && element8 != null) { element8.setAttribute("display", "none"); document.getElementById("pointure8").remove(); } var element9 = document.getElementById('pointure9'); if (typeof(element9) != 'undefined' && element9 != null) { element9.setAttribute("display", "none"); document.getElementById("pointure9").remove(); } var element10 = document.getElementById('pointure10'); if (typeof(element10) != 'undefined' && element10 != null) { element10.setAttribute("display", "none"); document.getElementById("pointure10").remove(); } $( "#dialog-modalPointure" ).dialog( "close" ); } //20200923 rajout popup pointure function addPanier(refgroupee,taille,boolPanierCoeur) { if (taille=='') { swal("ALERT_CHOOSETAILLE") //$( "#dialog-modal" ).dialog({ // height: 140, // modal: true // }); } else { //20200923 rajout popup pointure //20200923 Si on rempli le panier a partir du click sur un coeur on ne fait rien if (boolPanierCoeur==1) { } //20200923 rajout popup pointure else { $("#ajoutPanier").html("PRODUIT_AJOUTE"); $("#ajoutPanier").css("background-color","#FFFFFF"); $("#ajoutPanier").css("color","#000"); setTimeout('$("#ajoutPanier").html("BUTTON_AJOUTERPANIER");$("#ajoutPanier").css("background-color","#000");$("#ajoutPanier").css("color","#FFFFFF");',2000); } $.ajax({ type: "POST", url: "/en/catalogue_ajaxPanier.html", data: { action:'add', refgroupee:refgroupee, taille:taille }, success: updateDivPanier }); } return false; } function changeQuantity(refunique,plusmoins) { $.ajax({ type: "POST", url: "/en/catalogue_ajaxPanier.html", data: { action:'quantity', refunique:refunique, plusmoins:plusmoins }, success: updatePanier }); } function deletePanier(refunique) { $.ajax({ type: "POST", url: "/en/catalogue_ajaxPanier.html", data: { action:'delete', refunique:refunique }, success: updateDivPanier }); } function updatePanier(readonly) { $("#big_panier").load("/en/catalogue_ajaxPanier.html",{action:'updatebig',readonly:readonly}); } function updateDivPanier() { $.ajax({type: "POST",url: "/en/catalogue_ajaxPanier.html",data:{action:'visible'},success:function(data) { $("#panier").load("/en/catalogue_ajaxPanier.html",{action:'update'}); } }); } function extendPanier() { if ($("#panier_etendu").css("display")=='none') $("#panier_etendu").show("blind",200); else $("#panier_etendu").hide("blind",200); return false; } function applyPromo(code) { $.ajax({ type: "POST", url: "/en/catalogue_ajaxPanier.html", data: { action:'promo', code:code }, success: updatePanier }); }