Compare commits

..

4 Commits

Author SHA1 Message Date
2ea16f2b62 [Bump] Changelog && Metadata 2025-03-19 16:41:04 +01:00
b2a302fbb3 [Removed] over-engineered Getter-methods
- the methods would semi-automatic search and set/ save params
- I removed those and set it back to its base functionality:
-- saving happens ONLY at the save() function if triggered by the user in the admin-frontend
-- only one Getter who checks for a value in the DB ? give the value : no value given yet
2025-03-19 08:39:10 +01:00
e347739bd3 [Changed] remove save-logic from Getter-Method 2025-03-19 08:31:56 +01:00
3250f2bf91 [Changed] clear code 2025-03-10 22:51:22 +01:00
6 changed files with 11 additions and 54 deletions

View File

@ -21,7 +21,7 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
$this->addTplParam('d3ViewObject', $this); $this->addTplParam('d3ViewObject', $this);
$this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class)); $this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class));
$this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList()); $this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList());
$this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getCurrManager()); $this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getActManager());
return $return; return $return;
} }

View File

@ -7,35 +7,6 @@ use OxidEsales\Eshop\Core\ViewConfig;
class ManagerHandler class ManagerHandler
{ {
/**
* Gets current chosen Manager
*
* @return string
*/
public function getCurrManager() :string
{
/** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class);
/** @var ViewConfig $oViewConfig */
$oViewConfig = oxNew(ViewConfig::class);
$aManagerList = $oManagerTypes->getManagerList();
if ($this->getModuleSettingExplicitManagerSelectValue()){
return $this->getExplicitManager();
}
foreach ($aManagerList as $shopModuleId => $publicCMPName){
if ($oViewConfig->isModuleActive($shopModuleId)){
$this->d3SaveShopConfVar($shopModuleId);
return $shopModuleId;
}
}
return "";
}
/** /**
* @param string $sParam * @param string $sParam
* @return void * @return void
@ -53,26 +24,8 @@ class ManagerHandler
/** /**
* @return string * @return string
*/ */
public function getModuleSettingExplicitManagerSelectValue() :string public function getActManager() :string
{ {
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:""; return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
}
/**
* @return string
*/
public function getExplicitManager() :string
{
$sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue();
/** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class);
$sCMPName = $oManagerTypes->isManagerInList($sPotentialManagerName)
? $sPotentialManagerName
: "NONE";
$this->d3SaveShopConfVar($sCMPName);
return $sCMPName;
} }
} }

View File

@ -6,7 +6,6 @@
[{capture name="d3_ga4_view_item"}] [{capture name="d3_ga4_view_item"}]
[{strip}] [{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({ dataLayer.push({
'event': 'view_item', 'event': 'view_item',
'eventLabel':'Product View', 'eventLabel':'Product View',

View File

@ -4,10 +4,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...rel_2.x) - 2025-x ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.2...rel_2.x) - 2025-x
### Added ### Added
- data layer doesn't contain prices if current user hasn't "show price" rights - data layer doesn't contain prices if current user hasn't "show price" rights
## [2.23.0.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...2.23.0.2) - 2025-03-19
### Fixed
- unwanted reste of chosen CMP in admin
- over-engineered method construct
## [2.23.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.0...2.23.0.1) - 2025-02-19 ## [2.23.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.0...2.23.0.1) - 2025-02-19
### Fixed ### Fixed
- false metadata view_cart entry - false metadata view_cart entry

View File

@ -54,7 +54,7 @@ class ViewConfig extends ViewConfig_parent
{ {
/** @var ManagerHandler $oManagerHandler */ /** @var ManagerHandler $oManagerHandler */
$oManagerHandler = oxNew(ManagerHandler::class); $oManagerHandler = oxNew(ManagerHandler::class);
$this->sCookieManagerType = $oManagerHandler->getCurrManager(); $this->sCookieManagerType = $oManagerHandler->getActManager();
} }
} }

View File

@ -52,7 +52,7 @@ $aModule = [
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a> Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
", ",
'thumbnail' => 'thumbnail.png', 'thumbnail' => 'thumbnail.png',
'version' => '2.23.0.1', 'version' => '2.23.0.2',
'author' => 'Data Development (Inh.: Thomas Dartsch)', 'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com', 'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/', 'url' => 'https://www.oxidmodule.com/',