From e2564f613a7533c03b98ad8a9d763d0c576afc15 Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Mon, 18 Dec 2023 11:59:12 +0100 Subject: [PATCH] [Changed] capture implementation reworked to a safer path-through to get the data --- Application/views/blocks/purchase.tpl | 4 ++-- Application/views/blocks/view_cart.tpl | 4 ++-- Application/views/blocks/view_item.tpl | 4 ++-- Application/views/ga4/remove_from_cart.tpl | 4 ++-- Application/views/ga4/view_item_list.tpl | 4 ++-- Application/views/ga4/view_search_result.tpl | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Application/views/blocks/purchase.tpl b/Application/views/blocks/purchase.tpl index 3419a43..9878983 100644 --- a/Application/views/blocks/purchase.tpl +++ b/Application/views/blocks/purchase.tpl @@ -1,7 +1,7 @@ [{$smarty.block.parent}] [{block name="d3_ga4_purchase_block"}] - [{capture assign=d3_ga4_purchase}] + [{capture name="d3_ga4_purchase"}] [{strip}] dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ [{assign var="gtmOrder" value=$oView->getOrder()}] @@ -52,5 +52,5 @@ }) [{/strip}] [{/capture}] - [{oxscript add=$d3_ga4_purchase}] + [{oxscript add=$smarty.capture.d3_ga4_purchase}] [{/block}] \ No newline at end of file diff --git a/Application/views/blocks/view_cart.tpl b/Application/views/blocks/view_cart.tpl index 765bfe8..0ac03f3 100644 --- a/Application/views/blocks/view_cart.tpl +++ b/Application/views/blocks/view_cart.tpl @@ -6,7 +6,7 @@ [{assign var='gtmCartArticles' value=$oView->getBasketArticles()}] [{block name="d3_ga4_view_cart_block"}] - [{capture assign=d3_ga4_view_cart}] + [{capture name="d3_ga4_view_cart"}] [{strip}] dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ dataLayer.push({ @@ -46,5 +46,5 @@ }); [{/strip}] [{/capture}] - [{oxscript add=$d3_ga4_view_cart}] + [{oxscript add=$smarty.capture.d3_ga4_view_cart}] [{/block}] \ No newline at end of file diff --git a/Application/views/blocks/view_item.tpl b/Application/views/blocks/view_item.tpl index e79852e..c274d42 100644 --- a/Application/views/blocks/view_item.tpl +++ b/Application/views/blocks/view_item.tpl @@ -4,7 +4,7 @@ [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] [{block name="d3_ga4_view_item_block"}] - [{capture assign=d3_ga4_view_item}] + [{capture name="d3_ga4_view_item"}] [{strip}] dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ @@ -36,5 +36,5 @@ }); [{/strip}] [{/capture}] - [{oxscript add=$d3_ga4_view_item}] + [{oxscript add=$smarty.capture.d3_ga4_view_item}] [{/block}] \ No newline at end of file diff --git a/Application/views/ga4/remove_from_cart.tpl b/Application/views/ga4/remove_from_cart.tpl index 8c41746..72e7c6b 100644 --- a/Application/views/ga4/remove_from_cart.tpl +++ b/Application/views/ga4/remove_from_cart.tpl @@ -3,7 +3,7 @@ [{block name="d3_ga4_remove_from_cart_block"}] [{if $hasBeenReloaded}] [{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}] - [{capture assign=d3_ga4_remove_from_cart}] + [{capture name="d3_ga4_remove_from_cart"}] [{strip}] dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ dataLayer.push({ @@ -43,6 +43,6 @@ }); [{/strip}] [{/capture}] - [{oxscript add=$d3_ga4_remove_from_cart}] + [{oxscript add=$smarty.capture.d3_ga4_remove_from_cart}] [{/if}] [{/block}] \ No newline at end of file diff --git a/Application/views/ga4/view_item_list.tpl b/Application/views/ga4/view_item_list.tpl index 12fb5e8..927e636 100644 --- a/Application/views/ga4/view_item_list.tpl +++ b/Application/views/ga4/view_item_list.tpl @@ -6,7 +6,7 @@ [{block name="d3_ga4_view_item_list_block"}] [{if $gtmProducts|@count}] - [{capture assign=d3_ga4_view_item_list}] + [{capture name="d3_ga4_view_item_list"}] [{strip}] dataLayer.push({ecommerce: null}); dataLayer.push({ @@ -41,6 +41,6 @@ }); [{/strip}] [{/capture}] - [{oxscript add=$d3_ga4_view_item_list}] + [{oxscript add=$smarty.capture.d3_ga4_view_item_list}] [{/if}] [{/block}] \ No newline at end of file diff --git a/Application/views/ga4/view_search_result.tpl b/Application/views/ga4/view_search_result.tpl index 42e4c7b..cd1ed6c 100644 --- a/Application/views/ga4/view_search_result.tpl +++ b/Application/views/ga4/view_search_result.tpl @@ -4,7 +4,7 @@ [{block name="d3_ga4_view_search_result_block"}] [{if $gtmProducts|@count}] - [{capture assign=d3_ga4_view_search_result}] + [{capture name="d3_ga4_view_search_result"}] [{strip}] dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ dataLayer.push({ @@ -39,6 +39,6 @@ }); [{/strip}] [{/capture}] - [{oxscript add=$d3_ga4_view_search_result}] + [{oxscript add=$smarty.capture.d3_ga4_view_search_result}] [{/if}] [{/block}] \ No newline at end of file