var parsed = []; var addItemButton = document.getElementsByClassName("binPicture"); if (window.location.pathname.includes("/warenkorb.html")) { document.addEventListener("DOMContentLoaded", function () { var addItemButton = document.getElementById("jetztReservieren"); addItemButton.addEventListener('click', parseAttributes) deleteItem() }); } if (window.location.pathname.includes("/meinebuecher.html")) { document.addEventListener("DOMContentLoaded", function () { warenkorby = localStorage.getItem("meinebuecher") || []; const parsedArray = JSON.parse(warenkorby) addingMeinBuecher(parsedArray) } );} function deleteItem() { updateArticle() //Dieser Code Block gehört zur Warenkorb Datei for(var i = 0;i

${titling}

${discription}

Sofort Abholbereit

Diese Reservierung verfällt, wenn das Buch nicht bis zum 24.04.2023 abgeholt wurde.


` parsed.push(cartRowConetent) } // convert array to JSON string using JSON.stringify() const jsonArray = JSON.stringify(parsed); // save to localStorage using "array" as the key and jsonArray as the value localStorage.setItem('meinebuecher', jsonArray); localStorage.removeItem('items'); } function addingMeinBuecher(wat) { // var cartItems = document.getElementsByClassName('containerOfAll')[0]; for (var i = 0; i < wat.length; i++) { /* var cartRow = document.createElement('div'); cartRow.insertAdjacentHTML('beforeend', wat[i]); cartItems.appendChild(cartRow); */ insertHTMLStringToContainer(wat[i],"containerofmeinebuecher") } } function insertHTMLStringToContainer(htmlString, containerId) { var container = document.getElementsByClassName(containerId)[0]; container.insertAdjacentHTML('beforeend', htmlString); } function addingAll(wat) { // var cartItems = document.getElementsByClassName('containerOfAll')[0]; for (var i = 0; i < wat.length; i++) { /* var cartRow = document.createElement('div'); cartRow.insertAdjacentHTML('beforeend', wat[i]); cartItems.appendChild(cartRow); */ insertHTMLStringToContainer(wat[i],"containerOfAll") } }