From f47db26fa6f622582ce063ad34ede446eb699828 Mon Sep 17 00:00:00 2001 From: marination Date: Thu, 3 Feb 2022 12:54:59 +0530 Subject: [PATCH] fix: Cart buttons not working - Add cart.js to web bundle - Hide icon conditionally since now this file loads on every single page --- erpnext/public/js/cart.js | 4 +++- erpnext/public/js/erpnext-web.bundle.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/cart.js b/erpnext/public/js/cart.js index 0c970450be6..69357ee6ef9 100644 --- a/erpnext/public/js/cart.js +++ b/erpnext/public/js/cart.js @@ -292,7 +292,9 @@ $.extend(shopping_cart, { }); frappe.ready(function() { - $(".cart-icon").hide(); + if (window.location.pathname === "/cart") { + $(".cart-icon").hide(); + } shopping_cart.parent = $(".cart-container"); shopping_cart.bind_events(); }); diff --git a/erpnext/public/js/erpnext-web.bundle.js b/erpnext/public/js/erpnext-web.bundle.js index cbe899dc060..576abd2686f 100644 --- a/erpnext/public/js/erpnext-web.bundle.js +++ b/erpnext/public/js/erpnext-web.bundle.js @@ -1,6 +1,7 @@ import "./website_utils"; import "./wishlist"; import "./shopping_cart"; +import "./cart"; import "./customer_reviews"; import "../../e_commerce/product_ui/list"; import "../../e_commerce/product_ui/views";