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

  • May 21, 2024
  • 2 replies
  • 965 views

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.
Best answer by Mohan_Dugganab

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

 

 

2 replies

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe 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}}

 

 

SatheeskannaK
Community Advisor
Community Advisor
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}}

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

SatheeskannaK
Community Advisor
Community Advisor
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.

Thanks, Sathees