2023-01-11 15:04:41 +01:00
|
|
|
[{$smarty.block.parent}]
|
2021-07-17 23:22:23 +02:00
|
|
|
|
2023-01-12 08:38:51 +01:00
|
|
|
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
2021-07-17 23:22:23 +02:00
|
|
|
|
2023-05-10 15:01:56 +02:00
|
|
|
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
|
|
|
|
2023-01-11 15:04:41 +01:00
|
|
|
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
|
|
|
[{strip}][{capture assign=d3_ga4_view_cart}]
|
|
|
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
|
|
dataLayer.push({
|
|
|
|
'event': 'view_cart',
|
|
|
|
'eventLabel':'Checkout Step 1',
|
|
|
|
'ecommerce': {
|
|
|
|
'actionField': "step: 1",
|
|
|
|
'currency': "[{$currency->name}]",
|
2023-05-10 15:01:56 +02:00
|
|
|
'value': [{$d3BasketPrice->getPrice()}],
|
2023-01-11 15:04:41 +01:00
|
|
|
'items': [
|
|
|
|
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
2023-05-10 15:01:56 +02:00
|
|
|
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
2023-01-11 15:04:41 +01:00
|
|
|
{
|
2023-05-10 15:01:56 +02:00
|
|
|
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
|
|
|
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
|
|
|
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
|
|
|
'price': [{$d3oItemPrice->getPrice()}],
|
2023-01-11 15:04:41 +01:00
|
|
|
'quantity':[{$basketitem->getAmount()}],
|
|
|
|
'position':[{$smarty.foreach.gtmCartContents.index}]
|
|
|
|
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
|
|
|
[{/foreach}]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
});
|
|
|
|
[{/capture}][{/strip}]
|
|
|
|
[{oxscript add=$d3_ga4_view_cart}]
|