Compare commits

..

No commits in common. "rel_2.x" and "2.23.0.1" have entirely different histories.

6 changed files with 56 additions and 13 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)->getActManager()); $this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getCurrManager());
return $return; return $return;
} }

View File

@ -7,6 +7,35 @@ 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
@ -24,8 +53,26 @@ class ManagerHandler
/** /**
* @return string * @return string
*/ */
public function getActManager() :string public function getModuleSettingExplicitManagerSelectValue() :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,6 +6,7 @@
[{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,19 +4,14 @@ 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.2...rel_2.x) - 2025-x ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...rel_2.x) - 2025-x
### Added
## [2.23.0.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...2.23.0.2) - 2025-03-19 - data layer doesn't contain prices if current user hasn't "show price" rights
### Fixed
- reset of cmp-selection
- over-engineered getter-methods
## [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
- missing menu-translation - missing menu-translation
### Added
- data layer doesn't contain prices if current user hasn't "show price" rights
## [2.23.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...2.23.0.0) - 2024-12-21 ## [2.23.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...2.23.0.0) - 2024-12-21
### Added ### Added

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->getActManager(); $this->sCookieManagerType = $oManagerHandler->getCurrManager();
} }
} }

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.2', 'version' => '2.23.0.1',
'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/',