[Added] auto safe on first approach ga4 + cmp-mod

This commit is contained in:
MaxBUhe 2024-05-31 15:46:10 +02:00
parent 0dc5565640
commit e500814e7e

View File

@ -22,13 +22,30 @@ class ManagerHandler
$aManagerList = $oManagerTypes->getManagerList(); $aManagerList = $oManagerTypes->getManagerList();
foreach ($aManagerList as $managerName){ if ($this->getModuleSettingExplicitManagerSelectValue()){
if ($oViewConfig->isModuleActive($managerName)){ return $this->getExplicitManager();
return $managerName;
}
} }
return $this->getExplicitManager(); foreach ($aManagerList as $shopModuleId => $publicCMPName){
if ($oViewConfig->isModuleActive($shopModuleId)){
$this->d3SaveShopConfVar($shopModuleId);
return $shopModuleId;
}
}
}
/**
* @param string $sParam
* @return void
*/
public function d3SaveShopConfVar(string $sParam){
Registry::getConfig()->saveShopConfVar(
'select',
Constants::OXID_MODULE_ID."_HAS_STD_MANAGER",
$sParam,
Registry::getConfig()->getShopId(),
Constants::OXID_MODULE_ID
);
} }
/** /**
@ -48,8 +65,12 @@ class ManagerHandler
/** @var ManagerTypes $oManagerTypes */ /** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class); $oManagerTypes = oxNew(ManagerTypes::class);
return $oManagerTypes->isManagerInList($sPotentialManagerName) $sCMPName = $oManagerTypes->isManagerInList($sPotentialManagerName)
? $sPotentialManagerName ? $sPotentialManagerName
: "NONE"; : "NONE";
$this->d3SaveShopConfVar($sCMPName);
return $sCMPName;
} }
} }