Advertisement
Guest User

Untitled

a guest
Nov 12th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. if(typeof Checkout === "object"){
  2. if(typeof Checkout.$ === "function"){ Checkout.$(".alt-payment-list").remove(); }
  3. if(typeof Checkout.$ === "function"){ Checkout.$(".alternative-payment-separator").remove(); }
  4. }
  5.  
  6. // Timer code de réservation de la commande
  7.  
  8. function createCookie(a,b,c){if(c){var d=new Date;d.setTime(d.getTime()+c*60*1e3);var e="; expires="+d.toUTCString()}else var e="";document.cookie=a+"="+b+e+"; path=/"}function readCookie(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){for(var e=c[d];" "==e.charAt(0);)e=e.substring(1,e.length);if(0==e.indexOf(b))return e.substring(b.length,e.length)}return null}function eraseCookie(a){createCookie(a,"",-1)}function crtmedir(a){var b=document.createDocumentFragment(),c=document.createElement("div");for(c.innerHTML=a;c.firstChild;)b.appendChild(c.firstChild);return b}function startTimer(start, duration, display){var diff,minutes,seconds;function timer(){diff=duration-(((Date.now()-start)/1000)|0);minutes=(diff / 60)|0;seconds = (diff % 60)|0;minutes = minutes < 10 ? "0" + minutes : minutes;seconds = seconds < 10 ? "0" + seconds : seconds;display.textContent = minutes + ":" + seconds; if (diff <= 0){clearInterval(inti);document.getElementById("countdownhere").innerHTML = "La réservation de la commande est terminée.";start = Date.now() + 1000;}};timer();var inti = setInterval(timer, 1000);}var pdm = crtmedir('<div class="countdownholder"><div id="countdownhere" style="display:block;background:#fff5d2;padding:10px 20px;border:1px solid #e3df74;font-size:14px;color:#2c2c2c;font-weight:bold;-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px; margin:20px 0px">Votre commande est réservée pour <span id="time"></span> minutes!</div></div>');if(window.location.href.indexOf('checkout') > -1 && document.location.href.indexOf('thank_you') === -1 && document.location.href.indexOf('orders') === -1){window.onload = function () { document.getElementsByClassName('main__header')[0].appendChild(pdm);var dolzina=10;var ten=60*dolzina;var starttime=Date.now();var xcnt=readCookie('prtcntdwn');if(xcnt){if(starttime<xcnt){ten=(xcnt-starttime)/1000;}else{eraseCookie('ptcntdwn');createCookie('prtcntdwn',Date.now()+(ten*1000),ten+1);}}else{createCookie('prtcntdwn',Date.now()+(ten*1000),ten+1);}display=document.querySelector('#time');startTimer(starttime, ten, display);};}
  9.  
  10. // Fin du code du timer de réservation de la commande
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement