From 10386ccbf5a3eab8d1fcf08d1ca1f36856dfff12 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 3 Jun 2024 12:02:44 +0200 Subject: [PATCH] [Added] onActivate/ onDeactivate --- Setup/Actions.php | 30 ++++++++++++++++++++++++++++++ Setup/Events.php | 37 +++++++++++++++++++++++++++++++++++++ metadata.php | 6 +++++- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 Setup/Actions.php create mode 100644 Setup/Events.php diff --git a/Setup/Actions.php b/Setup/Actions.php new file mode 100644 index 0000000..ff577d6 --- /dev/null +++ b/Setup/Actions.php @@ -0,0 +1,30 @@ +saveShopConfVar( + $sVarType, + Constants::OXID_MODULE_ID.$sSettingName, + $sSettingValue, + $oConfig->getShopId(), + Constants::OXID_MODULE_ID + ); + } +} \ No newline at end of file diff --git a/Setup/Events.php b/Setup/Events.php new file mode 100644 index 0000000..aa0d67e --- /dev/null +++ b/Setup/Events.php @@ -0,0 +1,37 @@ +d3SaveDefaultSettings( + 'str', + '_sServersidetagging_js', + 'https://www.googletagmanager.com/gtm.js' + ); + $oActions->d3SaveDefaultSettings( + 'str', + '_sServersidetagging_js', + 'https://www.googletagmanager.com/ns.html' + ); + $oActions->d3SaveDefaultSettings( + 'str', + '_sContainerID', + 'GTM-' + ); + } + + /** + * @return void + */ + public static function onDeactivate(){} +} \ No newline at end of file diff --git a/metadata.php b/metadata.php index 98c07e1..447e519 100755 --- a/metadata.php +++ b/metadata.php @@ -175,5 +175,9 @@ $aModule = [ 'file' => '/Application/views/blocks/remove_from_cart.tpl', 'position' => 150 ] - ] + ], + 'events' => [ + 'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate', + 'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate', + ], ]; \ No newline at end of file