Fix: Restore website functionality - all pages and APIs working

This commit is contained in:
Local Server
2026-01-14 07:16:04 -06:00
parent dc58a8ae5f
commit 9f659a2c59
41 changed files with 10890 additions and 3029 deletions

View File

@@ -359,7 +359,11 @@
if (cartBadge) {
const count = this.getCartCount();
cartBadge.textContent = count;
cartBadge.style.display = count > 0 ? "flex" : "none";
if (count > 0) {
cartBadge.classList.add("show");
} else {
cartBadge.classList.remove("show");
}
}
// Update wishlist badge
@@ -367,7 +371,11 @@
if (wishlistBadge) {
const count = this.wishlist.length;
wishlistBadge.textContent = count;
wishlistBadge.style.display = count > 0 ? "flex" : "none";
if (count > 0) {
wishlistBadge.classList.add("show");
} else {
wishlistBadge.classList.remove("show");
}
}
}
@@ -463,14 +471,14 @@
const footer = document.querySelector("#cartPanel .dropdown-foot");
if (!footer) return;
if (total === 0) {
if (total === 0 || total === null) {
footer.innerHTML =
'<a href="/shop" class="btn-outline">Continue Shopping</a>';
} else {
footer.innerHTML = `
<div class="cart-total">
<span>Total:</span>
<strong>$${total.toFixed(2)}</strong>
<strong>${window.Utils.formatCurrency(total)}</strong>
</div>
<a href="/shop" class="btn-text">Continue Shopping</a>
<button class="btn-primary-full" onclick="alert('Checkout coming soon!')">