From ba9d430c9f4d14c512b450d61ed609c3e40e198e Mon Sep 17 00:00:00 2001 From: JaJuMa Date: Mon, 13 Oct 2025 20:07:19 +0700 Subject: [PATCH 1/2] fix: update actionRefreshMiniCart to reload wishlist customer data --- view/frontend/templates/bfcache/handler.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/frontend/templates/bfcache/handler.phtml b/view/frontend/templates/bfcache/handler.phtml index b48b663..9a75604 100644 --- a/view/frontend/templates/bfcache/handler.phtml +++ b/view/frontend/templates/bfcache/handler.phtml @@ -107,8 +107,8 @@ $script = << { + customerData.reload([], true); }); } From ff75f7312db709329e315b16f17ef9ec27e81e89 Mon Sep 17 00:00:00 2001 From: JaJuMa Date: Tue, 14 Oct 2025 10:18:57 +0700 Subject: [PATCH 2/2] fix: update customer data initialization logic in BFCache handler --- view/frontend/templates/bfcache/handler.phtml | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/view/frontend/templates/bfcache/handler.phtml b/view/frontend/templates/bfcache/handler.phtml index 9a75604..e8ef8ca 100644 --- a/view/frontend/templates/bfcache/handler.phtml +++ b/view/frontend/templates/bfcache/handler.phtml @@ -48,6 +48,7 @@ $script = << { - customerData.reload([], true); - }); + this.initCustomerData(); } /** * Close minicart & optionally close mobile menu */ actionAutoCloseMenu(autoCloseMenuMobile) { - require([ - 'Magento_Customer/js/customer-data' - ], ((customerData) => { - customerData.reload(['messages'], true); - + this.initCustomerData(() => { const minicartCloseButton = document.querySelector(this.selectors.minicartCloseButton); if (minicartCloseButton) { minicartCloseButton.click(); @@ -129,9 +122,24 @@ $script = << { + if (!this._customerDataInitialized) { + customerData.init(); + this._customerDataInitialized = true; + } + if (callback && typeof callback === 'function') { + callback(); + } + }); + } + /** * Handle closing of mobile menu */