[Changed] code cleanup

php cs fixer
This commit is contained in:
2024-11-25 18:48:39 +01:00
parent 2cd0652c31
commit c27834536d
47 changed files with 273 additions and 239 deletions

View File

@ -1,13 +1,15 @@
<?php <?php
$finder = PhpCsFixer\Finder::create() $finder = PhpCsFixer\Finder::create()
->in(__DIR__) ->in(__DIR__)
; ;
$config = new PhpCsFixer\Config(); $config = new PhpCsFixer\Config();
return $config->setRules([ return $config->setRules([
'@PHP73Migration' => true, '@PHP81Migration' => true,
'@PSR12' => true '@PSR12' => true,
]) 'php_unit_test_class_requires_covers' => true,
->setFinder($finder) 'doctrine_annotation_indentation' => true,
; ])
->setFinder($finder)
;

View File

@ -41,10 +41,10 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
'_blEnableUsercentricsConsentModeApi', '_blEnableUsercentricsConsentModeApi',
]; ];
foreach ($aCheckBoxParams as $checkBoxName){ foreach ($aCheckBoxParams as $checkBoxName) {
if (isset($aParams['bool'][$checkBoxName])){ if (isset($aParams['bool'][$checkBoxName])) {
$aParams['bool'][$checkBoxName] = true; $aParams['bool'][$checkBoxName] = true;
}else{ } else {
$aParams['bool'][$checkBoxName] = false; $aParams['bool'][$checkBoxName] = false;
} }
} }
@ -60,8 +60,8 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
{ {
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
foreach ($aParams as $sConfigType => $aConfigParams) { foreach ($aParams as $sConfigType => $aConfigParams) {
foreach ($aConfigParams as $sParamName => $sParamValue){ foreach ($aConfigParams as $sParamName => $sParamValue) {
if($this->d3GetModuleConfigParam($sParamName) !== $sParamValue){ if ($this->d3GetModuleConfigParam($sParamName) !== $sParamValue) {
$oConfig->saveShopConfVar( $oConfig->saveShopConfVar(
$sConfigType, $sConfigType,
Constants::OXID_MODULE_ID.$sParamName, Constants::OXID_MODULE_ID.$sParamName,

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model\CMP; namespace D3\GoogleAnalytics4\Application\Model\CMP;
abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface
{ {
public string $sCMPName; public string $sCMPName;

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model\CMP; namespace D3\GoogleAnalytics4\Application\Model\CMP;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
/** /**
@ -18,8 +17,8 @@ use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
*/ */
class Usercentrics extends ConsentManagementPlatformBaseModel class Usercentrics extends ConsentManagementPlatformBaseModel
{ {
const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics"; public const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics";
const sExternalIncludationInternalName = "usercentrics"; public const sExternalIncludationInternalName = "usercentrics";
const sModuleIncludationPublicName = "( Modul ) Usercentrics"; public const sModuleIncludationPublicName = "( Modul ) Usercentrics";
const sModuleIncludationInternalName = "oxps_usercentrics"; public const sModuleIncludationInternalName = "oxps_usercentrics";
} }

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model; namespace D3\GoogleAnalytics4\Application\Model;
class Constants class Constants
{ {
public const OXID_MODULE_ID = 'd3googleanalytics4'; public const OXID_MODULE_ID = 'd3googleanalytics4';

View File

@ -12,7 +12,7 @@ class ManagerHandler
* *
* @return string * @return string
*/ */
public function getCurrManager() :string public function getCurrManager(): string
{ {
/** @var ManagerTypes $oManagerTypes */ /** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class); $oManagerTypes = oxNew(ManagerTypes::class);
@ -22,15 +22,15 @@ class ManagerHandler
$aManagerList = $oManagerTypes->getManagerList(); $aManagerList = $oManagerTypes->getManagerList();
if ($this->getModuleSettingExplicitManagerSelectValue()){ if ($this->getModuleSettingExplicitManagerSelectValue()) {
return $this->getExplicitManager(); return $this->getExplicitManager();
} }
foreach ($aManagerList as $shopModuleId => $publicCMPName){ foreach ($aManagerList as $shopModuleId => $publicCMPName) {
if ($oViewConfig->d3IsModuleActive($shopModuleId)){ if ($oViewConfig->d3IsModuleActive($shopModuleId)) {
$this->d3SaveShopConfVar($shopModuleId); $this->d3SaveShopConfVar($shopModuleId);
return $shopModuleId; return $shopModuleId;
} }
} }
return ""; return "";
@ -40,7 +40,8 @@ class ManagerHandler
* @param string $sParam * @param string $sParam
* @return void * @return void
*/ */
public function d3SaveShopConfVar(string $sParam){ public function d3SaveShopConfVar(string $sParam)
{
Registry::getConfig()->saveShopConfVar( Registry::getConfig()->saveShopConfVar(
'select', 'select',
Constants::OXID_MODULE_ID."_HAS_STD_MANAGER", Constants::OXID_MODULE_ID."_HAS_STD_MANAGER",
@ -53,15 +54,15 @@ class ManagerHandler
/** /**
* @return string * @return string
*/ */
public function getModuleSettingExplicitManagerSelectValue() :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 * @return string
*/ */
public function getExplicitManager() :string public function getExplicitManager(): string
{ {
$sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue(); $sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue();

View File

@ -6,26 +6,26 @@ use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
class ManagerTypes class ManagerTypes
{ {
const EXTERNAL_SERVICE = "eigener Service"; public const EXTERNAL_SERVICE = "eigener Service";
const INTERNAL_EXTERNAL_SERVICE = "externalService"; public const INTERNAL_EXTERNAL_SERVICE = "externalService";
const NET_COOKIE_MANAGER = "Netensio Cookie Manager"; public const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager"; public const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager";
/** /**
* Further information's: * Further information's:
* https://github.com/aggrosoft/oxid-cookie-compliance * https://github.com/aggrosoft/oxid-cookie-compliance
*/ */
const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance"; public const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance"; public const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
const CONSENTMANAGER = "Consentmanager"; public const CONSENTMANAGER = "Consentmanager";
const INTERNAL_CONSENTMANAGER = "cmconsentmanager"; public const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
const COOKIEFIRST = "Cookiefirst"; public const COOKIEFIRST = "Cookiefirst";
const INTERNAL_COOKIEFIRST = "cookiefirst"; public const INTERNAL_COOKIEFIRST = "cookiefirst";
const COOKIEBOT = "Cookiebot"; public const COOKIEBOT = "Cookiebot";
const INTERNAL_COOKIEBOT = "cookiebot"; public const INTERNAL_COOKIEBOT = "cookiebot";
/** /**
* @return array * @return array
@ -48,25 +48,25 @@ class ManagerTypes
* @param string $sManager * @param string $sManager
* @return bool * @return bool
*/ */
public function isManagerInList(string $sManager) :bool public function isManagerInList(string $sManager): bool
{ {
return in_array($sManager, array_keys($this->getManagerList()), true); return in_array($sManager, array_keys($this->getManagerList()), true);
} }
/** /**
* @return array * @return array
* *
* the CMP from this method always needs the script tag delivered to the dom. * the CMP from this method always needs the script tag delivered to the dom.
*/ */
public function scriptTagDeliveredByDefaultArray() :array public function scriptTagDeliveredByDefaultArray(): array
{ {
return [ return [
Usercentrics::sModuleIncludationInternalName, Usercentrics::sModuleIncludationInternalName,
Usercentrics::sExternalIncludationInternalName, Usercentrics::sExternalIncludationInternalName,
ManagerTypes::INTERNAL_CONSENTMANAGER, ManagerTypes::INTERNAL_CONSENTMANAGER,
ManagerTypes::INTERNAL_COOKIEFIRST, ManagerTypes::INTERNAL_COOKIEFIRST,
ManagerTypes::INTERNAL_COOKIEBOT, ManagerTypes::INTERNAL_COOKIEBOT,
ManagerTypes::INTERNAL_EXTERNAL_SERVICE ManagerTypes::INTERNAL_EXTERNAL_SERVICE,
]; ];
} }
} }

View File

@ -1,9 +1,10 @@
<?php <?php
$sLangName = "Deutsch"; $sLangName = "Deutsch";
// ------------------------------- // -------------------------------
// RESOURCE IDENTITFIER = STRING // RESOURCE IDENTITFIER = STRING
// ------------------------------- // -------------------------------
$aLang = array( $aLang = [
'charset' => 'UTF-8', 'charset' => 'UTF-8',
'd3mxgoogleanalytics4' => 'Google Analytics 4', 'd3mxgoogleanalytics4' => 'Google Analytics 4',
@ -120,4 +121,4 @@ Nachher:
src="{Domain}?id={Container-ID}" src="{Domain}?id={Container-ID}"
</code> </code>
</pre>', </pre>',
); ];

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.

View File

@ -4,9 +4,7 @@ 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.22.0...rel_2.x) - 2024-x ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x
### Added
- data layer doesn't contain prices if current user hasn't "show price" rights
## [2.22.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.21.0...2.22.0) - 2024-09-21 ## [2.22.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.21.0...2.22.0) - 2024-09-21
### Fixed ### Fixed

View File

@ -14,18 +14,28 @@
*/ */
namespace D3\GoogleAnalytics4\Modules\Core{ namespace D3\GoogleAnalytics4\Modules\Core{
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig{} class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Model{ namespace D3\GoogleAnalytics4\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Payment; use OxidEsales\Eshop\Application\Model\Payment;
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {} class Category_parent extends \OxidEsales\Eshop\Application\Model\Category
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {} {
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {} }
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket
{
}
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer
{
}
class gtmPayment_parent extends Payment {} class gtmPayment_parent extends Payment
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Controller{ namespace D3\GoogleAnalytics4\Modules\Application\Controller{
@ -38,36 +48,60 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller{
use OxidEsales\Eshop\Application\Controller\SearchController; use OxidEsales\Eshop\Application\Controller\SearchController;
use OxidEsales\Eshop\Application\Controller\StartController; use OxidEsales\Eshop\Application\Controller\StartController;
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {} class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {} {
}
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController
{
}
class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController {} class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController
{
}
class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController {} class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController
{
}
class d3GtmAccountNoticeListController_parent extends AccountNoticeListController {} class d3GtmAccountNoticeListController_parent extends AccountNoticeListController
{
}
class d3GtmAccountRecommlistController_parent extends AccountRecommlistController {} class d3GtmAccountRecommlistController_parent extends AccountRecommlistController
{
}
class d3GtmAccountWishlistController_parent extends AccountWishlistController {} class d3GtmAccountWishlistController_parent extends AccountWishlistController
{
}
class d3GtmStartController_parent extends StartController {} class d3GtmStartController_parent extends StartController
{
}
class d3GtmSearchController_parent extends SearchController {} class d3GtmSearchController_parent extends SearchController
{
}
class d3GtmManufacturerListController_parent extends ManufacturerController {} class d3GtmManufacturerListController_parent extends ManufacturerController
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Component{ namespace D3\GoogleAnalytics4\Modules\Application\Component{
use OxidEsales\Eshop\Application\Component\BasketComponent; use OxidEsales\Eshop\Application\Component\BasketComponent;
class d3GtmBasketComponentExtension_parent extends BasketComponent {} class d3GtmBasketComponentExtension_parent extends BasketComponent
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{ namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails; use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails;
class d3GtmWidgetArticleDetails_parent extends ArticleDetails {} class d3GtmWidgetArticleDetails_parent extends ArticleDetails
{
}
} }

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget; namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget;
class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent
{ {
public function render() public function render()

View File

@ -24,9 +24,9 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
$iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am'); $iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am');
if ($iAmountArticlesAddedToCart){ if ($iAmountArticlesAddedToCart) {
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart); Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart);
}else{ } else {
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1); Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1);
} }
@ -36,7 +36,7 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
/** /**
* @return int * @return int
*/ */
public function getD3GtmAddToCartAmountArticles() :int public function getD3GtmAddToCartAmountArticles(): int
{ {
$iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles'); $iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles');
@ -48,7 +48,7 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
/** /**
* @return bool * @return bool
*/ */
public function getAddToBasketDecision() :bool public function getAddToBasketDecision(): bool
{ {
$decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger'); $decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger');
@ -66,7 +66,7 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
$oArticle = null; $oArticle = null;
if ($sAnid){ if ($sAnid) {
/** @var Article $oArticle */ /** @var Article $oArticle */
$oArticle = oxNew(Article::class); $oArticle = oxNew(Article::class);
$oArticle->load($sAnid); $oArticle->load($sAnid);

View File

@ -26,7 +26,7 @@ class BasketController extends BasketController_parent
* @return void * @return void
* @throws oxSystemComponentException * @throws oxSystemComponentException
*/ */
public function d3GA4getRemovedArticlesListObject() :void public function d3GA4getRemovedArticlesListObject(): void
{ {
$this->addTplParam('hasBeenReloaded', false); $this->addTplParam('hasBeenReloaded', false);
// collecting items to add // collecting items to add
@ -52,7 +52,7 @@ class BasketController extends BasketController_parent
'am' => $dAmount, 'am' => $dAmount,
'sel' => $aSel, 'sel' => $aSel,
'persparam' => $aPersParam, 'persparam' => $aPersParam,
'basketitemid' => $sBasketItemId 'basketitemid' => $sBasketItemId,
]; ];
} }
@ -84,9 +84,9 @@ class BasketController extends BasketController_parent
#dumpVar($this->getBasketArticles()); #dumpVar($this->getBasketArticles());
/** @var Article $item */ /** @var Article $item */
foreach ($oArtList->getArray() as $item){ foreach ($oArtList->getArray() as $item) {
foreach ($artIdOnArtAmountList as $artId => $artAmount){ foreach ($artIdOnArtAmountList as $artId => $artAmount) {
if ($item->getId() === $artId){ if ($item->getId() === $artId) {
$item->assign(['d3AmountThatGotRemoved' => $artAmount]); $item->assign(['d3AmountThatGotRemoved' => $artAmount]);
} }
} }
@ -104,13 +104,13 @@ class BasketController extends BasketController_parent
* if that doesn't work, we check if there's an Article in the Products array, that has "'am' = 0" * 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 * Which also shows we're in that state rn
*/ */
protected function isArticleRemovedState(array $productsArray) :bool protected function isArticleRemovedState(array $productsArray): bool
{ {
if (Registry::getRequest()->getRequestEscapedParameter('removeBtn') if (Registry::getRequest()->getRequestEscapedParameter('removeBtn')
or Registry::getRequest()->getRequestEscapedParameter('updateBtn') or Registry::getRequest()->getRequestEscapedParameter('updateBtn')
){ ) {
return true; return true;
}else{ } else {
foreach ($productsArray as $aProduct) { foreach ($productsArray as $aProduct) {
if (intval($aProduct['am']) === 0) { if (intval($aProduct['am']) === 0) {
return true; return true;

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent
{ {
public function render() public function render()

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmSearchController extends d3GtmSearchController_parent class d3GtmSearchController extends d3GtmSearchController_parent
{ {
/** /**
@ -14,7 +13,7 @@ class d3GtmSearchController extends d3GtmSearchController_parent
{ {
$return = parent::render(); $return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())){ if (false === in_array('oxcmp_basket', $this->getComponents())) {
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); $this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
} }

View File

@ -10,7 +10,7 @@ class d3GtmStartController extends d3GtmStartController_parent
{ {
$return = parent::render(); $return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())){ if (false === in_array('oxcmp_basket', $this->getComponents())) {
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); $this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
} }

View File

@ -9,11 +9,11 @@ class Basket extends Basket_parent
/** /**
* @return string * @return string
*/ */
public function getPaymentOnPaymentId() :string public function getPaymentOnPaymentId(): string
{ {
if ($this->getPaymentId()){ if ($this->getPaymentId()) {
$oPayment = oxNew(Payment::class); $oPayment = oxNew(Payment::class);
if ($oPayment->load($this->getPaymentId())){ if ($oPayment->load($this->getPaymentId())) {
return $oPayment->getFieldData('oxdesc'); return $oPayment->getFieldData('oxdesc');
} }
} }

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Model; namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor
{ {
use articleTreeStructure; use articleTreeStructure;

View File

@ -8,9 +8,9 @@ trait articleTreeStructure
* @param int $indexOfArray * @param int $indexOfArray
* @return string * @return string
*/ */
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false): string
{ {
if ($bShallTakeStd){ if ($bShallTakeStd) {
$splitCatArray = $splitCatArray =
array_values( array_values(
array_filter( array_filter(
@ -26,9 +26,9 @@ trait articleTreeStructure
) )
); );
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){ if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))) {
return $splitCatArray[$indexOfArray]; return $splitCatArray[$indexOfArray];
}else{ } else {
return ""; return "";
} }
} }

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Model; namespace D3\GoogleAnalytics4\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\Payment; use OxidEsales\Eshop\Application\Model\Payment;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
@ -13,8 +12,8 @@ class gtmPayment extends gtmPayment_parent
/** /**
* @return string * @return string
*/ */
public function gtmGetSelectedPaymentName() :string public function gtmGetSelectedPaymentName(): string
{ {
return $this->getFieldData('oxpayments__oxdesc')?: 'No payment name available'; return $this->getFieldData('oxpayments__oxdesc') ?: 'No payment name available';
} }
} }

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
@ -28,7 +29,6 @@ use Psr\Container\NotFoundExceptionInterface;
class ViewConfig extends ViewConfig_parent class ViewConfig extends ViewConfig_parent
{ {
// Google Tag Manager Container ID // Google Tag Manager Container ID
private $sContainerId = null; private $sContainerId = null;
@ -40,8 +40,7 @@ class ViewConfig extends ViewConfig_parent
public function getGtmContainerId() public function getGtmContainerId()
{ {
if ($this->sContainerId === null) if ($this->sContainerId === null) {
{
$this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID"); $this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID");
} }
return $this->sContainerId; return $this->sContainerId;
@ -50,10 +49,9 @@ class ViewConfig extends ViewConfig_parent
/** /**
* @return void * @return void
*/ */
public function defineCookieManagerType() :void public function defineCookieManagerType(): void
{ {
if ($this->sCookieManagerType === null) if ($this->sCookieManagerType === null) {
{
/** @var ManagerHandler $oManagerHandler */ /** @var ManagerHandler $oManagerHandler */
$oManagerHandler = oxNew(ManagerHandler::class); $oManagerHandler = oxNew(ManagerHandler::class);
$this->sCookieManagerType = $oManagerHandler->getCurrManager(); $this->sCookieManagerType = $oManagerHandler->getCurrManager();
@ -63,7 +61,7 @@ class ViewConfig extends ViewConfig_parent
/** /**
* @return bool * @return bool
*/ */
public function shallUseOwnCookieManager() :bool public function shallUseOwnCookieManager(): bool
{ {
return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager'); return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager');
} }
@ -76,7 +74,7 @@ class ViewConfig extends ViewConfig_parent
/** @var Config $oConfig */ /** @var Config $oConfig */
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
if (false === $this->isGA4enabled()){ if (false === $this->isGA4enabled()) {
return false; return false;
} }
@ -105,13 +103,11 @@ class ViewConfig extends ViewConfig_parent
} }
if ( if (
in_array in_array(
( $this->sCookieManagerType,
$this->sCookieManagerType, (oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray())
(oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray()) )
) ) {
)
{
// Always needs the script-tags delivered to the DOM. // Always needs the script-tags delivered to the DOM.
return true; return true;
} }
@ -125,32 +121,30 @@ class ViewConfig extends ViewConfig_parent
* This is especially important for UserCentrics. * This is especially important for UserCentrics.
* @return string * @return string
*/ */
public function getGtmScriptAttributes() :string public function getGtmScriptAttributes(): string
{ {
$sControlParameter = trim($this->d3GetModuleConfigParam('_sControlParameter')); $sControlParameter = trim($this->d3GetModuleConfigParam('_sControlParameter'));
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')){ if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')) {
return ""; return "";
} }
if ( if (
$this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName $this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
) ) {
{
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""'; return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
} }
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER) if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER) {
{
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"'; return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
} }
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEFIRST){ if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEFIRST) {
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"'; return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
} }
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEBOT){ if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEBOT) {
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"'; return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
} }
@ -163,22 +157,23 @@ class ViewConfig extends ViewConfig_parent
*/ */
public function isGA4enabled() public function isGA4enabled()
{ {
if ($this->blGA4enabled === null) if ($this->blGA4enabled === null) {
{
$this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGA4"); $this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGA4");
} }
return $this->blGA4enabled; return $this->blGA4enabled;
} }
public function isGtmConsentModeSetActivated() :bool public function isGtmConsentModeSetActivated(): bool
{ {
return $this->d3GetModuleConfigParam("_blEnableConsentMode")?: false; return $this->d3GetModuleConfigParam("_blEnableConsentMode") ?: false;
} }
public function getGtmDataLayer() public function getGtmDataLayer()
{ {
if (!$this->getGtmContainerId()) return "[]"; if (!$this->getGtmContainerId()) {
return "[]";
}
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
$oView = $oConfig->getTopActiveView(); $oView = $oConfig->getTopActiveView();
@ -213,9 +208,9 @@ class ViewConfig extends ViewConfig_parent
return json_encode([$dataLayer], JSON_PRETTY_PRINT); return json_encode([$dataLayer], JSON_PRETTY_PRINT);
} }
public function isDebugModeOn() :bool public function isDebugModeOn(): bool
{ {
return $this->d3GetModuleConfigParam("_blEnableDebug")?: false; return $this->d3GetModuleConfigParam("_blEnableDebug") ?: false;
} }
/** /**
@ -223,9 +218,9 @@ class ViewConfig extends ViewConfig_parent
* @throws ContainerExceptionInterface * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function getServerSidetaggingJsDomain() :string public function getServerSidetaggingJsDomain(): string
{ {
return $this->d3GetModuleConfigParam("_sServersidetagging_js")?: ""; return $this->d3GetModuleConfigParam("_sServersidetagging_js") ?: "";
} }
/** /**
@ -233,9 +228,9 @@ class ViewConfig extends ViewConfig_parent
* @throws ContainerExceptionInterface * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function getServerSidetaggingNoJsDomain() :string public function getServerSidetaggingNoJsDomain(): string
{ {
return $this->d3GetModuleConfigParam('_sServersidetagging_nojs')?: ""; return $this->d3GetModuleConfigParam('_sServersidetagging_nojs') ?: "";
} }
/** /**
@ -250,7 +245,7 @@ class ViewConfig extends ViewConfig_parent
/** /**
* @return bool * @return bool
*/ */
public function d3IsUsercentricsCMPChosen() :bool public function d3IsUsercentricsCMPChosen(): bool
{ {
$sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER'); $sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER');
$aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList(); $aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList();
@ -259,25 +254,25 @@ class ViewConfig extends ViewConfig_parent
or $sCMPPubName === Usercentrics::sModuleIncludationInternalName); or $sCMPPubName === Usercentrics::sModuleIncludationInternalName);
} }
/** /**
* @return bool * @return bool
*/ */
public function d3IsModuleActive(string $sModuleId) :bool public function d3IsModuleActive(string $sModuleId): bool
{ {
/** @var ModuleActivationBridgeInterface $moduleActivationBridge */ /** @var ModuleActivationBridgeInterface $moduleActivationBridge */
$moduleActivationBridge = $this $moduleActivationBridge = $this
->getContainer() ->getContainer()
->get(ModuleActivationBridgeInterface::class); ->get(ModuleActivationBridgeInterface::class);
try { try {
$isActiveBool = $moduleActivationBridge->isActive( $isActiveBool = $moduleActivationBridge->isActive(
$sModuleId, $sModuleId,
Registry::getConfig()->getShopId() Registry::getConfig()->getShopId()
); );
}catch (\Exception|ModuleConfigurationNotFoundException $e){ } catch (\Exception|ModuleConfigurationNotFoundException $e) {
return false; return false;
} }
return (bool) $isActiveBool; return (bool) $isActiveBool;
} }
} }

View File

@ -4,7 +4,8 @@ namespace D3\GoogleAnalytics4\Modules\Core;
use OxidEsales\EshopCommunity\Core\Registry; use OxidEsales\EshopCommunity\Core\Registry;
class WidgetControl extends WidgetControl_parent{ class WidgetControl extends WidgetControl_parent
{
protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
{ {
/* /*
@ -27,14 +28,12 @@ class WidgetControl extends WidgetControl_parent{
) )
*/ */
$sScriptName = $_SERVER['SCRIPT_NAME']; $sScriptName = $_SERVER['SCRIPT_NAME'];
if($sScriptName !== '/widget.php') if ($sScriptName !== '/widget.php') {
{
return parent::getFrontendStartControllerKey(); return parent::getFrontendStartControllerKey();
} }
$aParameter = $_GET; $aParameter = $_GET;
if(is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent'])) if (is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent'])) {
{
return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget'; return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget';
} }

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Setup; namespace D3\GoogleAnalytics4\Setup;
use D3\GoogleAnalytics4\Application\Model\Constants; use D3\GoogleAnalytics4\Application\Model\Constants;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\ViewConfig; use OxidEsales\Eshop\Core\ViewConfig;
@ -17,10 +16,11 @@ class Actions
* @param string $sSettingValue * @param string $sSettingValue
* @return void * @return void
*/ */
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){ public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue)
{
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))){ if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))) {
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName)); $sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
} }

View File

@ -4,7 +4,6 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Setup; namespace D3\GoogleAnalytics4\Setup;
class Events class Events
{ {
/** /**
@ -33,5 +32,7 @@ class Events
/** /**
* @return void * @return void
*/ */
public static function onDeactivate(){} public static function onDeactivate()
{
}
} }

View File

@ -37,9 +37,16 @@
"google/apiclient":" ^2.0", "google/apiclient":" ^2.0",
"phpstan/phpstan": "^1.10" "phpstan/phpstan": "^1.10"
}, },
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.9"
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"D3\\GoogleAnalytics4\\": "" "D3\\GoogleAnalytics4\\": ""
} }
},
"scripts": {
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/google-analytics4/.php-cs-fixer.php",
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/google-analytics4/.php-cs-fixer.php"
} }
} }

View File

@ -57,7 +57,7 @@ $aModule = [
'email' => 'support@shopmodule.com', 'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/', 'url' => 'https://www.oxidmodule.com/',
'controllers' => [ 'controllers' => [
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class 'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class,
], ],
'extend' => [ 'extend' => [
// Core // Core
@ -114,45 +114,48 @@ $aModule = [
'template' => 'layout/base.tpl', 'template' => 'layout/base.tpl',
'block' => 'head_meta_robots', 'block' => 'head_meta_robots',
'file' => 'views/smarty/blocks/_gtm_js.tpl', 'file' => 'views/smarty/blocks/_gtm_js.tpl',
'position' => 150 'position' => 150,
], ],
// tag manager nojs // tag manager nojs
[ [
'template' => 'layout/base.tpl', 'template' => 'layout/base.tpl',
'block' => 'theme_svg_icons', 'block' => 'theme_svg_icons',
'file' => 'views/smarty/blocks/_gtm_nojs.tpl' 'file' => 'views/smarty/blocks/_gtm_nojs.tpl',
'position' => 150,
], ],
// details // details
[ [
'template' => 'page/details/inc/productmain.tpl', 'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_title', 'block' => 'details_productmain_title',
'file' => 'views/smarty/blocks/view_item.tpl', 'file' => 'views/smarty/blocks/view_item.tpl',
'position' => 150 'position' => 150,
], ],
// View Cart // View Cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main', 'block' => 'checkout_basket_main',
'file' => 'views/smarty/blocks/view_cart.tpl' 'file' => 'views/smarty/blocks/view_cart.tpl',
'position' => 150,
], ],
// add_to_cart // add_to_cart
[ [
'template' => 'page/details/inc/productmain.tpl', 'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_tobasket', 'block' => 'details_productmain_tobasket',
'file' => 'views/smarty/blocks/details_productmain_tobasket.tpl', 'file' => 'views/smarty/blocks/details_productmain_tobasket.tpl',
'position' => 150 'position' => 150,
], ],
// remove_from_cart // remove_from_cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main', 'block' => 'checkout_basket_main',
'file' => 'views/smarty/blocks/remove_from_cart.tpl', 'file' => 'views/smarty/blocks/remove_from_cart.tpl',
'position' => 150 'position' => 150,
], ],
[ [
'template' => 'page/checkout/thankyou.tpl', 'template' => 'page/checkout/thankyou.tpl',
'block' => 'checkout_thankyou_main', 'block' => 'checkout_thankyou_main',
'file' => 'views/smarty/blocks/purchase.tpl' 'file' => 'views/smarty/blocks/purchase.tpl',
'position' => 150,
], ],
// Lists // Lists
// view_item_list // view_item_list
@ -160,26 +163,26 @@ $aModule = [
'template' => 'page/list/list.tpl', 'template' => 'page/list/list.tpl',
'block' => 'page_list_productlist', 'block' => 'page_list_productlist',
'file' => 'views/smarty/blocks/view_item_list.tpl', 'file' => 'views/smarty/blocks/view_item_list.tpl',
'position' => 150 'position' => 150,
], ],
// view_search_result // view_search_result
[ [
'template' => 'page/search/search.tpl', 'template' => 'page/search/search.tpl',
'block' => 'search_results', 'block' => 'search_results',
'file' => 'views/smarty/blocks/view_search_result.tpl', 'file' => 'views/smarty/blocks/view_search_result.tpl',
'position' => 150 'position' => 150,
], ],
[ [
'template' => 'page/list/list.tpl', 'template' => 'page/list/list.tpl',
'block' => 'page_list_listbody', 'block' => 'page_list_listbody',
'file' => 'views/smarty/blocks/page_list_listbody.tpl', 'file' => 'views/smarty/blocks/page_list_listbody.tpl',
'position' => 150 'position' => 150,
], ],
[ [
'template' => 'page/shop/start.tpl', 'template' => 'page/shop/start.tpl',
'block' => 'start_welcome_text', 'block' => 'start_welcome_text',
'file' => 'views/smarty/blocks/start_welcome_text.tpl', 'file' => 'views/smarty/blocks/start_welcome_text.tpl',
'position' => 150 'position' => 150,
], ],
// Checkout process // Checkout process
// Begin CHeckout // Begin CHeckout
@ -187,7 +190,7 @@ $aModule = [
'template' => 'page/checkout/user.tpl', 'template' => 'page/checkout/user.tpl',
'block' => 'checkout_user_main', 'block' => 'checkout_user_main',
'file' => 'views/smarty/blocks/begin_checkout.tpl', 'file' => 'views/smarty/blocks/begin_checkout.tpl',
'position' => 150 'position' => 150,
], ],
// Add payment info // Add payment info
// We add it into checkout_order_main ( checkout/order.tpl ) to make sure a payment is actually added; // We add it into checkout_order_main ( checkout/order.tpl ) to make sure a payment is actually added;
@ -196,7 +199,7 @@ $aModule = [
'template' => 'page/checkout/order.tpl', 'template' => 'page/checkout/order.tpl',
'block' => 'checkout_order_main', 'block' => 'checkout_order_main',
'file' => 'views/smarty/blocks/add_payment_info.tpl', 'file' => 'views/smarty/blocks/add_payment_info.tpl',
'position' => 150 'position' => 150,
], ],
], ],
'events' => [ 'events' => [

View File

@ -1,4 +1,4 @@
[{include file="ga4/admin/d3ga4uiheaditem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}] [{include file="@d3googleanalytics4/admin/d3ga4uiheaditem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
<style> <style>
body { body {
background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%); background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);

View File

@ -36,7 +36,7 @@
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmItemPriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$gtmItemPriceObject->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}], 'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}] 'position': [{$smarty.foreach.gtmCartContents.index}]

View File

@ -37,7 +37,7 @@
{ {
'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]', 'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]',
'item_name': '[{$oGtmProduct->getFieldData('oxtitle')}]', 'item_name': '[{$oGtmProduct->getFieldData('oxtitle')}]',
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->getFieldData('oxvarselect')}][{/if}]', 'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->getFieldData('oxvarselect')}][{/if}]',
[{if $gtmCategory}] [{if $gtmCategory}]

View File

@ -35,7 +35,7 @@
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}] 'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}], 'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}] 'position': [{$smarty.foreach.gtmCartContents.index}]

View File

@ -40,7 +40,7 @@
'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmPurchaseItemPriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$gtmPurchaseItemPriceObject->getPrice()}],
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}], 'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
'position': [{$smarty.foreach.gtmArticles.iteration}] 'position': [{$smarty.foreach.gtmArticles.iteration}]
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}] }[{if !$smarty.foreach.gtmArticles.last}],[{/if}]

View File

@ -28,7 +28,7 @@
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}] 'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', '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')}]', 'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
'position': [{$smarty.foreach.gtmRemovedItems.index}] 'position': [{$smarty.foreach.gtmRemovedItems.index}]

View File

@ -33,7 +33,7 @@
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}] 'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}], 'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}] 'position': [{$smarty.foreach.gtmCartContents.index}]

View File

@ -28,7 +28,7 @@
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]', 'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}] [{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}][{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}]
} }
] ]
}[{if $oViewConf->isDebugModeOn()}], }[{if $oViewConf->isDebugModeOn()}],

View File

@ -22,7 +22,7 @@
{ {
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]', 'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]', 'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmCategory}] [{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',

View File

@ -18,7 +18,7 @@
{ {
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]', 'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]', 'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmCategory}] [{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',