Spaces:
Sleeping
Sleeping
Update templates/cart.html
Browse files- templates/cart.html +2 -0
templates/cart.html
CHANGED
@@ -204,6 +204,8 @@
|
|
204 |
quantityInput.value = quantity;
|
205 |
let itemPriceElement = document.querySelector(`.cart-item[data-item-name="${itemName}"] .text-primary`);
|
206 |
itemPriceElement.innerHTML = `$<span class="base-price">${data.new_item_price}</span>`;
|
|
|
|
|
207 |
|
208 |
// Recalculate subtotal dynamically
|
209 |
calculateSubtotal();
|
|
|
204 |
quantityInput.value = quantity;
|
205 |
let itemPriceElement = document.querySelector(`.cart-item[data-item-name="${itemName}"] .text-primary`);
|
206 |
itemPriceElement.innerHTML = `$<span class="base-price">${data.new_item_price}</span>`;
|
207 |
+
document.querySelector(`[data-item-name="${itemName}"] .base-price`).innerText = data.new_item_price.toFixed(2);
|
208 |
+
document.querySelector('.cart-summary p').innerText = `Subtotal: $${data.subtotal.toFixed(2)}`;
|
209 |
|
210 |
// Recalculate subtotal dynamically
|
211 |
calculateSubtotal();
|