Fix double-click cart/wishlist issue: prevent duplicate initialization
This commit is contained in:
@@ -388,6 +388,11 @@
|
||||
|
||||
// Initialize when DOM is ready
|
||||
const initializeComponents = () => {
|
||||
// Skip if shop-system.js already initialized
|
||||
if (window.ShopSystem?.isInitialized) {
|
||||
console.log("[cart.js] Skipping initialization - shop-system.js already loaded");
|
||||
return;
|
||||
}
|
||||
console.log("[cart.js] Initializing ShoppingCart and Wishlist components");
|
||||
new ShoppingCart();
|
||||
new Wishlist();
|
||||
|
||||
Reference in New Issue
Block a user