[Changed] OXID 7 file adjustments

This commit is contained in:
MaxBuhe01 2024-09-21 18:16:52 +02:00
parent 8bbf7e4fa7
commit c539c898d9
48 changed files with 54 additions and 157 deletions

View File

@ -12,7 +12,7 @@ use OxidEsales\Eshop\Core\ViewConfig;
class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController
{ {
protected $_sThisTemplate = 'ga4/admin/d3ga4uimain.tpl'; protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain';
public function render() public function render()
{ {

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/add_payment_info.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/begin_checkout.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/purchase.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/remove_from_cart.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/view_cart.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/view_item.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/view_item_list.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="event/view_search_result.tpl"}]

View File

@ -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}]

View File

@ -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}]

View File

@ -4,7 +4,7 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent
{ {
protected $_sThisTemplate = 'page/account/d3gtmnoticelist.tpl'; protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmnoticelist.tpl';
public function render() public function render()
{ {

View File

@ -4,7 +4,7 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent
{ {
protected $_sThisTemplate = 'page/account/d3gtmrecommendationlist.tpl'; protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmrecommendationlist.tpl';
public function render() public function render()
{ {

View File

@ -4,7 +4,7 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent
{ {
protected $_sThisTemplate = 'page/account/d3gtmwishlist.tpl'; protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmwishlist.tpl';
public function render() public function render()
{ {

0
thumbnail.png → assets/thumbnail.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -28,20 +28,9 @@
"homepage": "https://www.d3data.de" "homepage": "https://www.d3data.de"
} }
], ],
"support": { "supports": {
"email": "support@shopmodule.com" "email": "support@shopmodule.com"
}, },
"extra": {
"oxideshop": {
"blacklist-filter": [
"*.md",
"composer.json",
".php-cs-fixer.php",
"*.neon"
],
"target-directory": "d3/googleanalytics4"
}
},
"require": { "require": {
"php": "7.1 - 8.2", "php": "7.1 - 8.2",
"oxid-esales/oxideshop-ce": "^6.5.3", "oxid-esales/oxideshop-ce": "^6.5.3",
@ -50,7 +39,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4" "D3\\GoogleAnalytics4\\": ""
} }
} }
} }

View File

@ -1,12 +1,12 @@
[{if $oViewConf->D3blShowGtmScript()}] [{if $oViewConf->D3blShowGtmScript()}]
[{if $oViewConf->getGtmContainerId()}][{strip}] [{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager (noscript) --> <!-- Google Tag Manager (noscript) -->
<noscript> <noscript>
<iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]" <iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]"
height="0" width="0" style="display:none;visibility:hidden"></iframe> height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript> </noscript>
<!-- End Google Tag Manager (noscript) --> <!-- End Google Tag Manager (noscript) -->
[{/strip}][{/if}] [{/strip}][{/if}]
[{/if}] [{/if}]
[{$smarty.block.parent}] [{$smarty.block.parent}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/add_payment_info.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/begin_checkout.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/purchase.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/remove_from_cart.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_cart.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_item.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_item_list.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_search_result.tpl"}]

View File

@ -41,4 +41,4 @@
[{/if}] [{/if}]
[{/block}] [{/block}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] [{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -8,7 +8,7 @@
<p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p> <p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p>
[{/if}] [{/if}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] [{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}] [{insert name="oxid_tracker" title=$template_title}]
[{/capture}] [{/capture}]

View File

@ -21,7 +21,7 @@
[{/if}] [{/if}]
[{/block}] [{/block}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] [{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}] [{insert name="oxid_tracker" title=$template_title}]
[{/capture}] [{/capture}]

View File

@ -34,7 +34,7 @@
</p> </p>
[{/if}] [{/if}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}] [{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}] [{insert name="oxid_tracker" title=$template_title}]
[{/capture}] [{/capture}]