diff --git a/view/frontend/templates/bfcache/handler.phtml b/view/frontend/templates/bfcache/handler.phtml index b48b663..e8ef8ca 100644 --- a/view/frontend/templates/bfcache/handler.phtml +++ b/view/frontend/templates/bfcache/handler.phtml @@ -48,6 +48,7 @@ $script = << { - 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 */