From 7c86c43d0c00b33ce8d28f68ce7d07b1e81a7b5c Mon Sep 17 00:00:00 2001 From: Henk de Gier Date: Tue, 25 Jun 2024 13:54:35 +0200 Subject: [PATCH] Prevent add_to_cart from firing twice Pulll request based on MaximGns' fix --- view/frontend/templates/hyva/script-additions.phtml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/view/frontend/templates/hyva/script-additions.phtml b/view/frontend/templates/hyva/script-additions.phtml index 083a9ff0..49f97b4c 100644 --- a/view/frontend/templates/hyva/script-additions.phtml +++ b/view/frontend/templates/hyva/script-additions.phtml @@ -64,10 +64,7 @@ $commons = $block->getCommonsViewModel(); if (!metaData || metaData.cacheable !== true) { yireoGoogleTagManager2Logger('removing event "' + eventId + '" from section "' + sectionName + '"') - let mageCacheStorage = window.localStorage.getItem('mage-cache-storage'); - if (mageCacheStorage) { - mageCacheStorage = JSON.parse(mageCacheStorage); - } + let mageCacheStorage = event.detail.data; if (mageCacheStorage !== null && typeof mageCacheStorage[sectionName] !== 'undefined'