renaming vars on puchase-tpl

This commit is contained in:
MaxBUhe 2023-06-21 15:47:06 +02:00
parent cb18feba82
commit 50f9fbca23
2 changed files with 37 additions and 37 deletions

View File

@ -1,36 +1,36 @@
[{$smarty.block.parent}] [{$smarty.block.parent}]
[{strip}] [{strip}]
<script> <script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
[{assign var="_gtmOrder" value=$oView->getOrder()}] [{assign var="gtmOrder" value=$oView->getOrder()}]
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}] [{assign var="gtmArticles" value=$gtmOrder->getOrderArticles()}]
dataLayer.push({ dataLayer.push({
'event': 'purchase', 'event': 'purchase',
'eventLabel':'Checkout Step 5', 'eventLabel':'Checkout Step 5',
'ecommerce': { 'ecommerce': {
'transaction_id': '[{$_gtmOrder->getFieldData("oxordernr")}]', 'transaction_id': '[{$gtmOrder->getFieldData("oxordernr")}]',
'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]', 'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]',
'value': [{$_gtmOrder->getTotalOrderSum()}], 'value': [{$gtmOrder->getTotalOrderSum()}],
'tax': [{math equation="x+y" x=$_gtmOrder->getFieldData("oxartvatprice1") y=$_gtmOrder->getFieldData("oxartvatprice2") }], 'tax': [{math equation="x+y" x=$gtmOrder->getFieldData("oxartvatprice1") y=$gtmOrder->getFieldData("oxartvatprice2") }],
'shipping': [{$_gtmOrder->getFieldData("oxdelcost")}], 'shipping': [{$gtmOrder->getFieldData("oxdelcost")}],
'currency': '[{$_gtmOrder->getFieldData('oxcurrency')}]', 'currency': '[{$gtmOrder->getFieldData('oxcurrency')}]',
'items': 'items':
[ [
[{foreach from=$_gtmArticles item="d3BasketArticle" name="gtmArticles"}] [{foreach from=$gtmArticles item="d3BasketArticle" name="gtmArticles"}]
[{assign var="d3oArticlePrice" value=$d3BasketArticle->getPrice()}] [{assign var="d3oArticlePrice" value=$d3BasketArticle->getPrice()}]
{ {
'id': '[{$d3BasketArticle->getFieldData("oxartnum")}]', 'id': '[{$d3BasketArticle->getFieldData("oxartnum")}]',
'name': '[{$d3BasketArticle->getFieldData("oxtitle")}]', 'name': '[{$d3BasketArticle->getFieldData("oxtitle")}]',
'variant': '[{$d3BasketArticle->getFieldData("oxselvariant")}]', 'variant': '[{$d3BasketArticle->getFieldData("oxselvariant")}]',
'price': [{$d3oArticlePrice->getPrice()}], 'price': [{$d3oArticlePrice->getPrice()}],
'quantity': [{$d3BasketArticle->getFieldData("oxamount")}], 'quantity': [{$d3BasketArticle->getFieldData("oxamount")}],
'position': [{$smarty.foreach.gtmArticles.iteration}] 'position': [{$smarty.foreach.gtmArticles.iteration}]
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}] }[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
[{/foreach}] [{/foreach}]
] ]
} }
}) })
</script> </script>
[{/strip}] [{/strip}]

View File

@ -63,7 +63,7 @@ $aModule = [
[ [
'template' => 'page/checkout/thankyou.tpl', 'template' => 'page/checkout/thankyou.tpl',
'block' => 'checkout_thankyou_main', 'block' => 'checkout_thankyou_main',
'file' => '/Application/views/blocks/checkout_s5.tpl' 'file' => '/Application/views/blocks/purchase.tpl'
], ],
// Lists // Lists
// view_item_list // view_item_list