Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let displayTotalPrice = document.createElement("span");
- cart.appendChild(displayTotalPrice);
- let totalPrice = 0;
- if(productData.hasOwnProperty("newPrice")) {
- productInfo.innerHTML = productData.name + " - " + productData.newPrice + "</br>";
- Number(totalPrice) += Number(productData.newPrice);
- }
- else {
- productInfo.innerHTML = productData.name + " - " + productData.price + "</br>";
- Number(totalPrice) += Number(productData.price);
- }
- displayTotalPrice.innerHTML = "Całkowita cena to: " + totalPrice;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement