Compare commits

...

3 Commits

Author SHA1 Message Date
MaxBUhe 99af4cdfa9 bump metadata && changelog 2023-09-07 15:16:54 +02:00
MaxBUhe eb2c7f73b9 add cookiebot essentials 2023-09-07 15:15:05 +02:00
MaxBUhe 575e35ffbc [changed] 'an article has been removed from basket'-check 2023-08-18 14:07:53 +02:00
7 changed files with 48 additions and 8 deletions

View File

@ -36,6 +36,8 @@ class ManagerTypes
const COOKIEFIRST = "COOKIEFIRST";
const COOKIEBOT = "COOKIEBOT";
/**
* @return array
*/
@ -48,7 +50,8 @@ class ManagerTypes
"oxps_usercentrics" => self::USERCENTRICS_MODULE,
"usercentrics" => self::USERCENTRICS_MANUALLY,
"consentmanager" => self::CONSENTMANAGER,
"cookiefirst" => self::COOKIEFIRST
"cookiefirst" => self::COOKIEFIRST,
"cookiebot" => self::COOKIEBOT,
];
}

View File

@ -43,5 +43,6 @@ $aLang = [
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'CookieID',
];

View File

@ -4,6 +4,10 @@ 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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.1...1.12.0) - 2023-09-07
### Added
- cookiebot functionality
## [1.11.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.0...1.11.1) - 2023-08-17
### Fixed
- metadata class entry

View File

@ -77,4 +77,7 @@ Aktivieren Sie anschlieĂźend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
- kleines Fragezeichen neben den Namen anklicken und ganz runter scrollen
- prĂĽfen, ob ein Cookie vorgegeben ist
- sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
- [Cookiebot](https://www.cookiebot.com)
- Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite.

View File

@ -52,7 +52,8 @@ class BasketController extends BasketController_parent
$sBasketItemId = Registry::getRequest()->getRequestEscapedParameter('bindex');
$aProducts[$sProductId] = ['am' => $dAmount,
$aProducts[$sProductId] = [
'am' => $dAmount,
'sel' => $aSel,
'persparam' => $aPersParam,
'basketitemid' => $sBasketItemId
@ -63,9 +64,7 @@ class BasketController extends BasketController_parent
$toRemoveArticleIdList = [];
$artIdOnArtAmountList = [];
if (Registry::getRequest()->getRequestEscapedParameter('removeBtn') !== null
or Registry::getRequest()->getRequestParameter('updateBtn') !== null) {
if ($this->isArticleRemovedState($aProducts)) {
//setting amount to 0 if removing article from basket
foreach ($aProducts as $sProductId => $aProduct) {
if ((isset($aProduct['remove']) && $aProduct['remove']) or intval($aProduct['am']) === 0) {
@ -100,4 +99,29 @@ class BasketController extends BasketController_parent
$this->addTplParam('toRemoveArticles', $oArtList);
}
}
/**
* @return bool
*
* checks, if we're in the short state of "an Article has been removed"
* We check by looking for the "'removeBtn' is not null", as a sign for it has been triggered/ clicked
* if that doesn't work, we check if there's an Article in the Products array, that has "'am' = 0"
* Which also shows we're in that state rn
*/
protected function isArticleRemovedState(array $productsArray) :bool
{
if (Registry::getRequest()->getRequestEscapedParameter('removeBtn')
or Registry::getRequest()->getRequestEscapedParameter('updateBtn')
){
return true;
}else{
foreach ($productsArray as $aProduct) {
if (intval($aProduct['am']) === 0) {
return true;
}
}
}
return false;
}
}

View File

@ -93,6 +93,7 @@ class ViewConfig extends ViewConfig_parent
or $this->sCookieManagerType === ManagerTypes::USERCENTRICS_MANUALLY
or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST
or $this->sCookieManagerType === ManagerTypes::COOKIEBOT
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
)
{
@ -143,6 +144,10 @@ class ViewConfig extends ViewConfig_parent
return 'type="text/plain" data-cookiefirst-category="' . $sCookieId .'"';
}
if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
return 'type="text/plain" data-cookieconsent="' . $sCookieId .'"';
}
return "";
}

View File

@ -28,7 +28,7 @@ $aModule = [
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',
'version' => '1.11.0',
'version' => '1.12.0',
'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
@ -144,7 +144,7 @@ $aModule = [
'name' => 'd3_gtm_settings_HAS_STD_MANAGER',
'type' => 'select',
'value' => 'none',
'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS|COOKIEFIRST',
'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS|COOKIEFIRST|COOKIEBOT',
],
]
];