Suppose that user have multiple products in the cart. How to iterate in email designer through every product (through productListItems) and put multiple product names in the design.
I have got something like this for now:
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Take a look at this example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...
Iteration is using the following "each" helper
{{#each context.journey.events.event_ID.productListItems as |product|}}
<table>
<tbody>
<tr>
<td><b>{{product.name}}</b></td>
<td><b>{{product.quantity}}</b></td>
<td><b>${{product.priceTotal}}</b></td>
</tr>
</tbody>
</table>
{{/each}}
Take a look at this example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...
Iteration is using the following "each" helper
{{#each context.journey.events.event_ID.productListItems as |product|}}
<table>
<tbody>
<tr>
<td><b>{{product.name}}</b></td>
<td><b>{{product.quantity}}</b></td>
<td><b>${{product.priceTotal}}</b></td>
</tr>
</tbody>
</table>
{{/each}}
@Michael_Soprano Small correction to the response posted by dugganab.
{{#each context.journey.events.event_ID.productListItems as |product|}}
<table>
<tbody>
<tr>
<td><b>{{product.name}}</b></td>
<td><b>{{product.quantity}}</b></td>
<td><b>${{product.priceTotal}}</b></td>
</tr>
</tbody>
</table>
{{/each}}
Do you know how to debug what productListItems array contains using front-end?
Even though I used your example I still have only one last product in mail ...
Views
Replies
Total Likes
@Michael_Soprano Use the journey test mode to test and specify more than one item to see how it works. Also, have a look at this similar post on how to get productlistitems data to display in the front end.
You can switch to code view in test mode and specify multiple objects in the productListItems array to validate if these are being shown in the email content.
For example -
"productListItems": [
{
"name": "Sprite Yoga Companion Kit",
"priceTotal": 61,
"quantity": 1,
"SKU": "24-WG080"
},
{
"name": "Nike Air Max",
"priceTotal": 200,
"quantity": 2,
"SKU": "31-YG010"
}
]
Well, it is indeed a miss in the documentation but there are examples called out in this page too https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalizatio...
Views
Likes
Replies