From d847a34e992d49a7ea4387e0ecb4baac5b366245 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Fri, 20 Jan 2023 11:24:30 +0100 Subject: [PATCH] set compatibility to oxid 6.5 and above --- Modules/Core/ViewConfig.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index f16c4af..1edbde2 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License along with this program; if not, see */ -namespace VanillaThunder\GoogleTagManager\Application\Extend; +namespace D3\GoogleAnalytics4\Modules\Core; use OxidEsales\Eshop\Application\Controller\FrontendController; use OxidEsales\Eshop\Core\Registry; @@ -30,7 +30,10 @@ class ViewConfig extends ViewConfig_parent { if ($this->sContainerId === null) { - $this->sContainerId = $this->getConfig()->getConfigParam('vt_gtm_sContainerID'); + $this->sContainerId = ContainerFactory::getInstance() + ->getContainer() + ->get(ModuleSettingBridgeInterface::class) + ->get('vt_gtm_sContainerID', 'vt-gtm'); } return $this->sContainerId; } @@ -41,7 +44,10 @@ class ViewConfig extends ViewConfig_parent { if ($this->blGA4enabled === null) { - $this->sContainerId = $this->getConfig()->getConfigParam('vt_gtm_blEnableGA4'); + $this->sContainerId = ContainerFactory::getInstance() + ->getContainer() + ->get(ModuleSettingBridgeInterface::class) + ->get('vt_gtm_blEnableGA4', 'vt-gtm'); } return $this->blGA4enabled; @@ -81,7 +87,7 @@ class ViewConfig extends ViewConfig_parent //'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown" ]; - #return json_encode([$dataLayer], JSON_PRETTY_PRINT); + return json_encode([$dataLayer], JSON_PRETTY_PRINT); unset($dataLayer["user"]["http"]); // das brauchen wir hier nicht