Compare commits
12 Commits
2.18.0
...
dev_2.x_re
Author | SHA1 | Date | |
---|---|---|---|
17a77bbf4c | |||
44d89a667b | |||
81c7051f7b | |||
29831fa157 | |||
cf143c4881 | |||
16387c59bb | |||
cc2e9a5fc6 | |||
97dad5c8eb | |||
b7167ec60a | |||
9e79835bc4 | |||
96033e1e03 | |||
a48356bc30 |
@ -32,6 +32,8 @@ class ManagerHandler
|
||||
return $shopModuleId;
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,7 +55,7 @@ class ManagerHandler
|
||||
*/
|
||||
public function getModuleSettingExplicitManagerSelectValue() :string
|
||||
{
|
||||
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER');
|
||||
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,6 +8,7 @@ $aLang = array(
|
||||
|
||||
'd3mxgoogleanalytics4' => 'Google Analytics 4',
|
||||
'd3mxgoogleanalytics4set' => 'Einstellungen',
|
||||
'd3mxd3modules' => "<i class='fab fa-fw fa-d3 d3fa-color-blue'></i> Module",
|
||||
|
||||
// Base Translations
|
||||
'D3BASECONFIG' => 'Grundeinstellungen',
|
||||
|
@ -1,48 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{block name="d3_ga4_remove_from_cart_block"}]
|
||||
[{if $hasBeenReloaded}]
|
||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||
[{capture assign=d3_ga4_remove_from_cart}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'isRemoveFromCart': true,
|
||||
'event': 'remove_from_cart',
|
||||
'eventLabel':'remove_from_cart',
|
||||
'ecommerce': {
|
||||
'actionField': "step: 1",
|
||||
'currency': "[{$currency->name}]",
|
||||
'value': [{$d3BasketPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'items': [
|
||||
[{foreach from=$toRemoveArticles->getArray() name=gtmRemovedItems item=rmItem key=rmItemindex}]
|
||||
[{assign var="d3oItemPrice" value=$rmItem->getPrice()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}]
|
||||
{
|
||||
'item_id': '[{$rmItem->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$rmItem->getFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]',
|
||||
[{if $gtmBasketItemCategory}]
|
||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$d3oItemPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
|
||||
'position': [{$smarty.foreach.gtmRemovedItems.index}]
|
||||
}[{if !$smarty.foreach.gtmRemovedItems.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_remove_from_cart}]
|
||||
[{/if}]
|
||||
[{/block}]
|
@ -1,44 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||
|
||||
[{block name="d3_ga4_view_search_result_block"}]
|
||||
[{if $gtmProducts}]
|
||||
[{capture assign=d3_ga4_view_search_result}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'event': 'view_search_result',
|
||||
'eventLabel':'view_search_result[{if $oViewConf->isDebugModeOn()}]_test[{/if}]',
|
||||
'ecommerce': {
|
||||
'search_term': '[{$searchparamforhtml}]',
|
||||
'items': [
|
||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||
{
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{if $gtmCategory}]
|
||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'quantity': 1
|
||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_search_result}]
|
||||
[{/if}]
|
||||
[{/block}]
|
@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x
|
||||
|
||||
## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-25
|
||||
### Fixed
|
||||
- oe-console apply-configuration triggers on-activate and overwrites existing values
|
||||
|
||||
## [2.18.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-04
|
||||
### Fixed
|
||||
- missing return statement, on null/ none
|
||||
|
||||
## [2.18.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...2.18.0) - 2024-06-03
|
||||
### Added
|
||||
- trait for generalized method
|
||||
|
@ -57,6 +57,26 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
|
||||
return (bool) $decision;
|
||||
}
|
||||
|
||||
public function getRemoveFromBasketDecision() :bool
|
||||
{
|
||||
$decision = Registry::getSession()->getVariable('d3GtmRemoveFromBasketTrigger');
|
||||
|
||||
Registry::getSession()->setVariable('d3GtmRemoveFromBasketTrigger', false);
|
||||
|
||||
return (bool) $decision;
|
||||
}
|
||||
|
||||
protected function _getItems($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false)
|
||||
{
|
||||
$aProducts = parent::_getItems($sProductId, $dAmount, $aSel, $aPersParam, $blOverride);
|
||||
|
||||
if (is_array($aProducts) && count($aProducts)) {
|
||||
Registry::getSession()->setVariable('d3GtmRemoveFromBasketTrigger', true);
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Article|null
|
||||
*/
|
||||
|
@ -173,7 +173,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
|
||||
public function isGtmConsentModeSetActivated() :bool
|
||||
{
|
||||
return $this->d3GetModuleConfigParam("_blEnableConsentMode");
|
||||
return $this->d3GetModuleConfigParam("_blEnableConsentMode")?: false;
|
||||
}
|
||||
|
||||
public function getGtmDataLayer()
|
||||
@ -215,7 +215,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
|
||||
public function isDebugModeOn() :bool
|
||||
{
|
||||
return $this->d3GetModuleConfigParam("_blEnableDebug");
|
||||
return $this->d3GetModuleConfigParam("_blEnableDebug")?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -225,7 +225,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
*/
|
||||
public function getServerSidetaggingJsDomain() :string
|
||||
{
|
||||
return $this->d3GetModuleConfigParam("_sServersidetagging_js");
|
||||
return $this->d3GetModuleConfigParam("_sServersidetagging_js")?: "";
|
||||
}
|
||||
|
||||
/**
|
||||
@ -235,7 +235,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
*/
|
||||
public function getServerSidetaggingNoJsDomain() :string
|
||||
{
|
||||
return $this->d3GetModuleConfigParam('_sServersidetagging_nojs');
|
||||
return $this->d3GetModuleConfigParam('_sServersidetagging_nojs')?: "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,6 +7,7 @@ namespace D3\GoogleAnalytics4\Setup;
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\ViewConfig;
|
||||
|
||||
class Actions
|
||||
{
|
||||
@ -19,6 +20,10 @@ class Actions
|
||||
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){
|
||||
$oConfig = Registry::getConfig();
|
||||
|
||||
if (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue)){
|
||||
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
|
||||
}
|
||||
|
||||
$oConfig->saveShopConfVar(
|
||||
$sVarType,
|
||||
Constants::OXID_MODULE_ID.$sSettingName,
|
||||
@ -27,4 +32,13 @@ class Actions
|
||||
Constants::OXID_MODULE_ID
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $configParamName
|
||||
* @return mixed
|
||||
*/
|
||||
public function d3GetModuleConfigParam(string $configParamName)
|
||||
{
|
||||
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName);
|
||||
}
|
||||
}
|
@ -50,7 +50,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' => '2.18.0',
|
||||
'version' => '2.18.2',
|
||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
|
Reference in New Issue
Block a user