abandon basket - multiple products - iteration in email | Community
Skip to main content
Michael_Soprano
Level 10
May 21, 2024
Solved

abandon basket - multiple products - iteration in email

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:

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Mohan_Dugganab
Mohan_DugganabAccepted solution
Employee
May 21, 2024

Take a look at this example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalization/personalization-use-cases/personalization-use-case-helper-functions#each-helper

 

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}}

 

 

6 replies

SatheeskannaK
Level 1
May 21, 2024

@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}}

Translate
Thanks, Sathees
Michael_Soprano
Level 10
May 21, 2024

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 ...

Translate
SatheeskannaK
Level 1
May 21, 2024

@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.

Translate
Thanks, Sathees
Mohan_Dugganab
Mohan_DugganabAccepted solution
Employee
May 21, 2024

Take a look at this example in the documentation https://experienceleague.adobe.com/en/docs/journey-optimizer/using/content-management/personalization/personalization-use-cases/personalization-use-case-helper-functions#each-helper

 

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}}

 

 

Translate