Mam pytanko o zmienną, {foreach} tak aby w warstwie danych były powielane kolejne produkty
dataLayer.push({
'ecommerce': {
'purchase': {
'actionField': {
'id': '{$order.details.reference}', // Transaction ID. Required for purchases and refunds.
'affiliation': 'sklep',
'revenue': '{$order.totals.total['amount']}', // Total transaction value (incl. tax and shipping)
'tax':'{$order.subtotals.tax['amount']}',
'shipping': '{$order.subtotals.shipping['amount']}',
'coupon': ''
},
'products': [{ ‼️Co tutaj wstawić? Jaką zmienną?‼️ // List of productFieldObjects.
'name': '{$product.name}', // Name or ID is required.
'id': '{$product.id_product}',
'price': '{$product.product_price_wt}',
'brand': '{$product.manufacturer_name}',
'category': '{$product.category}',
'quantity': '{$product.product_quantity}',
'coupon': '' // Optional fields may be omitted or set to empty string.
},
{
'name': '{$product.name}', // Name or ID is required.
'id': '{$product.id_product}',
'price': '{$product.product_price_wt}',
'brand': '{$product.manufacturer_name}',
'category': '{$product.category}',
'quantity': '{$product.product_quantity}',
}]
}
}
});
Question
kriswalus
Cześć Wielcy tego forum!
Mam pytanko o zmienną, {foreach} tak aby w warstwie danych były powielane kolejne produkty
dataLayer.push({
'ecommerce': {
'purchase': {
'actionField': {
'id': '{$order.details.reference}', // Transaction ID. Required for purchases and refunds.
'affiliation': 'sklep',
'revenue': '{$order.totals.total['amount']}', // Total transaction value (incl. tax and shipping)
'tax':'{$order.subtotals.tax['amount']}',
'shipping': '{$order.subtotals.shipping['amount']}',
'coupon': ''
},
'products': [{ ‼️ Co tutaj wstawić? Jaką zmienną? ‼️ // List of productFieldObjects.
'name': '{$product.name}', // Name or ID is required.
'id': '{$product.id_product}',
'price': '{$product.product_price_wt}',
'brand': '{$product.manufacturer_name}',
'category': '{$product.category}',
'quantity': '{$product.product_quantity}',
'coupon': '' // Optional fields may be omitted or set to empty string.
},
{
'name': '{$product.name}', // Name or ID is required.
'id': '{$product.id_product}',
'price': '{$product.product_price_wt}',
'brand': '{$product.manufacturer_name}',
'category': '{$product.category}',
'quantity': '{$product.product_quantity}',
}]
}
}
});
Dzięki za pomoc‼️
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now