var myArray = ["facebook","google","twitter"]; let redirect_url = ""; if(true){ const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const device = urlParams.get("device"); if(urlParams.get("checkout_url")){ redirect_url = urlParams.get("checkout_url"); }else{ redirect_url = urlParams.get("redirect_url"); } const application = urlParams.get("application"); if(device == "mobile" && application != null){ window.location.href = "https://shop.miniorange.com/social-login/openidcallback/"+application+"?state="+device+"&shop=onemerch-in.myshopify.com&hosts="+window.location.host+""; } }; var cartValue = getCookie("cart"); createCookie("cart",cartValue,15); function getCookie(cookieName) { let cookie = {}; document.cookie.split(";").forEach(function(el) { let [key,value] = el.split("="); cookie[key.trim()] = value; }) return cookie[cookieName]; } function createCookie(name, value, days) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); expires = "; expires=" + date.toGMTString(); } else { expires = ""; } document.cookie = name + "=" + value + expires + "; path=/"; }if(document.getElementById("mo_openid_login")){ document.getElementById("mo_openid_login").insertAdjacentHTML("beforebegin", "
"); }else if(document.getElementById("customer_login")){ document.getElementById("customer_login").insertAdjacentHTML("beforebegin", "
"); }else if(document.getElementById("RegisterForm")){ document.getElementById("RegisterForm").insertAdjacentHTML("beforebegin", "
"); } var logout_redirect=""; var logout_redirect_enable=""; if(document.getElementById("customer_logout_link") && logout_redirect_enable==1){ document.getElementById("customer_logout_link").setAttribute("onClick", "mo_logout_redirect()"); } function mo_logout_redirect(){ var b=window.open("https://onemerch-in.myshopify.com"+logout_redirect); wait(200); var a=window.open("", "_self", "").close(); } function wait(ms){ var start = new Date().getTime(); var end = start; while(end < start + ms) { end = new Date().getTime(); } } document.head.insertAdjacentHTML("afterbegin",""); document.head.insertAdjacentHTML("afterbegin",""); myArray.reverse().forEach(function (value) { if(document.getElementById("mo_openid_login")){ document.getElementById("mo_openid_login").insertAdjacentHTML("afterbegin",""); } });