webupdatev1

This commit is contained in:
Local Server
2026-01-04 17:52:37 -06:00
parent 1919f6f8bb
commit c1da8eff42
81 changed files with 16728 additions and 475 deletions

View File

@@ -182,7 +182,7 @@
? product.description.substring(0, 100) + "..."
: "");
const isInWishlist = window.AppState?.isInWishlist(id) || false;
const isInWishlist = window.ShopSystem?.isInWishlist(id) || false;
return `
<article class="product-card" data-id="${id}">
@@ -228,7 +228,7 @@
const id = parseInt(e.currentTarget.dataset.id);
const product = this.products.find((p) => p.id === id);
if (product) {
window.AppState.addToCart(product);
window.ShopSystem.addToCart(product, 1);
}
});
});
@@ -242,10 +242,10 @@
const id = parseInt(e.currentTarget.dataset.id);
const product = this.products.find((p) => p.id === id);
if (product) {
if (window.AppState.isInWishlist(id)) {
window.AppState.removeFromWishlist(id);
if (window.ShopSystem.isInWishlist(id)) {
window.ShopSystem.removeFromWishlist(id);
} else {
window.AppState.addToWishlist(product);
window.ShopSystem.addToWishlist(product);
}
this.renderProducts(this.products);
}