Lade Produkte...
"; // URL zur Shop-Seite mit Kategorie & Loop Container anpassen fetch(`/shop/?product_cat=${cat} .et_pb_ajax_pagination_container`) .then(res => res.text()) .then(html => { const temp = document.createElement("div"); temp.innerHTML = html; let loop = temp.querySelector(".et_pb_ajax_pagination_container"); if (loop) { container.innerHTML = loop.innerHTML; } else { container.innerHTML = "Keine Produkte gefunden.
"; } }) .catch(err => { container.innerHTML = "Fehler beim Laden.
"; }); } // Standard: erste Kategorie laden loadCategory("hosen"); // Tab-Klicks tabs.forEach(tab => { tab.addEventListener("click", function() { tabs.forEach(t => t.classList.remove("active")); this.classList.add("active"); loadCategory(this.dataset.cat); }); }); });