From 8a7c25fad96c6c7bbfac45192663a95f5dfc84cd Mon Sep 17 00:00:00 2001 From: MaxBUhe Date: Wed, 21 Jun 2023 15:58:46 +0200 Subject: [PATCH] [working state] add method for article category steps change naming of vars Not working yet: getting of category-steps --- Application/views/blocks/purchase.tpl | 28 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/Application/views/blocks/purchase.tpl b/Application/views/blocks/purchase.tpl index b815a92..04dd350 100644 --- a/Application/views/blocks/purchase.tpl +++ b/Application/views/blocks/purchase.tpl @@ -18,16 +18,24 @@ 'currency': '[{$gtmOrder->getFieldData('oxcurrency')}]', 'items': [ - [{foreach from=$gtmArticles item="d3BasketArticle" name="gtmArticles"}] - [{assign var="d3oArticlePrice" value=$d3BasketArticle->getPrice()}] - { - 'id': '[{$d3BasketArticle->getFieldData("oxartnum")}]', - 'name': '[{$d3BasketArticle->getFieldData("oxtitle")}]', - 'variant': '[{$d3BasketArticle->getFieldData("oxselvariant")}]', - 'price': [{$d3oArticlePrice->getPrice()}], - 'quantity': [{$d3BasketArticle->getFieldData("oxamount")}], - 'position': [{$smarty.foreach.gtmArticles.iteration}] - }[{if !$smarty.foreach.gtmArticles.last}],[{/if}] + [{foreach from=$gtmArticles item="gtmBasketItem" name="gtmArticles"}] + [{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}] + [{assign var="gtmPurchaseItemCategory" value=$gtmBasketItem->getCategory()}] + { + 'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]', + 'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]', + 'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]', + 'coupon': '[{$gtmBasketItem->getFieldData("oxtitle")}]', + 'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]', + 'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0)}]', + 'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1)}]', + 'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2)}]', + 'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3)}]', + 'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]', + 'price': [{$gtmPurchaseItemPriceObject->getPrice()}], + 'quantity': [{$gtmBasketItem->getFieldData("oxamount")}], + 'position': [{$smarty.foreach.gtmArticles.iteration}] + }[{if !$smarty.foreach.gtmArticles.last}],[{/if}] [{/foreach}] ] }