Manda-Shop
function removeURLParameter(url, parameter) { //prefer to use l.search if you have a location/link object var urlparts = url.split('?'); if (urlparts.length >= 2) { var prefix = encodeURIComponent(parameter) + '='; var pars = urlparts[1].split(/[&;]/g); //reverse iteration as may be destructive for (var i = pars.length; i-- > 0;) { //idiom for string.startsWith if (pars[i].lastIndexOf(prefix, 0) !== -1) { pars.splice(i, 1); } } return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : ''); } return url; } let elem = document.getElementsByClassName('filter-div')[0] let elembtn = document.getElementById("filter-btn") let elem1 = document.getElementsByClassName('sortieren-div')[0] let elembtn1 = document.getElementById("sortieren-btn") let elem2 = document.getElementsByClassName('rem-filter-div')[0] let elembtn2 = document.getElementById("rem-filter-btn") let elemdesktop = document.getElementsByClassName('filter-div')[0] let categorydiv = document.getElementsByClassName('category-div')[0].parentElement.parentElement if (elemdesktop){ elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); } let curopen = 0; function openFilterMenu(){ if ( elemdesktop.parentElement.parentElement.style.display === "block" || elemdesktop.parentElement.parentElement.style.display === "" ) { elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); } else { elem.classList.add('active') elemdesktop.parentElement.parentElement.style.display = "block"; categorydiv.style.flex = "0 0 75%"; $(categorydiv).css("max-width", "75%"); } openStuff() } function openSortMenu(){ if (elem1.classList.contains('active')){ elem1.classList.remove('active') } else { elem1.classList.add('active') } } elembtn.addEventListener("click", function(){ openFilterMenu(1) }) elembtn1.addEventListener("click", function(){ openSortMenu(1) }) function openStuff(){ let elems = document.getElementsByClassName("owl-loaded"); for (let i1 = 0; i1 < elems.length; i1++) { elems[i1].style.display = "none"; } setTimeout(function() { for (let i1 = 0; i1 < elems.length; i1++) { elems[i1].style.display = "block"; } }, 600); } elembtn2.addEventListener("click", function(){ const url = removeURLParameter(window.location.href, "facets") window.location.href=url // window.ceresStore.dispatch("selectFacet", {facetValue: [] }) })
let li_elements = document.getElementsByTagName("li") for (let i = 0; i < li_elements.length; i++){ if (li_elements[i].textContent.includes("SALE")){ console.log(li_elements[i].childNodes[0]) li_elements[i].childNodes[0].style.color = "red"; } } window.onload = function(e){ let elements = document.getElementsByClassName("cmp-product-thumb") $(".category-item-placeholder").css("min-height", elements[0].offsetHeight) let elems = document.getElementsByClassName("colorrechteck"); console.log(elems) for (let i_1 = 0; i_1 < elems.length; i_1++){ let allclasses = elems[i_1].className.split(" ") console.log(allclasses) for (let i1= 0; i1 < allclasses.length; i1++){ if (allclasses[i1].includes("rechteck-")){ let sp = allclasses[i1].split("-"); //elems[i_1].children[0].children[1].insertAdjacentHTML("beforeend", '') elems[i_1].children[0].children[1].insertAdjacentHTML("beforeend", `
`) elems[i_1].children[0].children[1].children[0].children[0].innerHTML = " " elems[i_1].style.backgroundColor= "#"+sp[1]; elems[i_1].style.padding= "10px" } } } } if (elemdesktop){ elemdesktop.parentElement.parentElement.style.display = "none"; categorydiv.style.flex = "0 0 100%"; $(categorydiv).css("max-width", "100%"); }