From 002cc69d2aea471da74f997f5f8d1fd97ff4c47b Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Tue, 23 May 2023 10:06:21 +0200 Subject: [PATCH] switch metadata entries; fix getPrice-bug --- Application/views/ga4/add_to_cart.tpl | 3 +- Application/views/ga4/view_item_list.tpl | 69 ++++++++++++------------ metadata.php | 10 +--- 3 files changed, 39 insertions(+), 43 deletions(-) diff --git a/Application/views/ga4/add_to_cart.tpl b/Application/views/ga4/add_to_cart.tpl index f431bc9..0721a48 100644 --- a/Application/views/ga4/add_to_cart.tpl +++ b/Application/views/ga4/add_to_cart.tpl @@ -1,6 +1,7 @@ [{$smarty.block.parent}] -[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}] +[{assign var="d3ProductObject" value=$oView->getProduct()}] +[{assign var="d3PriceObject" value=$d3ProductObject->getPrice()}] [{capture assign=d3_ga4_add_to_cart}] [{block name="d3_ga4_add_to_basket"}] diff --git a/Application/views/ga4/view_item_list.tpl b/Application/views/ga4/view_item_list.tpl index 0f9a99f..1c91e0e 100644 --- a/Application/views/ga4/view_item_list.tpl +++ b/Application/views/ga4/view_item_list.tpl @@ -1,35 +1,36 @@ -[{assign var="gtmProducts" value=$products}] -[{assign var="d3PriceObject" value=$gtmProducts->getPrice()}] - -[{assign var="breadCrumb" value=''}] - -[{if $gtmProducts|@count}] -[{strip}] - -[{/strip}] +[{$smarty.block.parent}] +[{assign var="gtmProducts" value=$products}] + +[{assign var="breadCrumb" value=''}] + +[{if $gtmProducts|@count}] +[{strip}] + +[{/strip}] [{/if}] \ No newline at end of file diff --git a/metadata.php b/metadata.php index 26dddbd..368f6ce 100755 --- a/metadata.php +++ b/metadata.php @@ -43,17 +43,11 @@ $aModule = [ 'block' => 'theme_svg_icons', 'file' => '/Application/views/blocks/_gtm_nojs.tpl' ], - // widget_product_list - [ - 'template' => 'widget/product/list.tpl', - 'block' => 'widget_product_list', - 'file' => '/Application/views/blocks/widget_product_list.tpl' - ], // details [ 'template' => 'page/details/inc/productmain.tpl', 'block' => 'details_productmain_title', - 'file' => '/Application/views/blocks/detail.tpl', + 'file' => '/Application/views/blocks/view_item.tpl', 'position' => 150 ], // checkout @@ -71,7 +65,7 @@ $aModule = [ // view_item_list [ 'template' => 'widget/product/list.tpl', - 'block' => 'd3Ga4_view_item_list', + 'block' => 'widget_product_list', 'file' => '/Application/views/ga4/view_item_list.tpl', 'position' => 150 ],