Trying to write a basket and that is my question.
When you click the add to cart button, this code is triggered.
i++; total2.innerHTML = '(' + i + ')'; button.innerHTML = "Товар уже в корзине"; localStorage.setItem(i, productName); And here was the question, how do I calculate and display the quantity of goods in the basket? Those. when you click on a button, localStorage.setItem(1, productName); added to localStorage.setItem(1, productName); And when entering the page, how can I display the quantity of goods?