Hi,
I have a request where I need to apply a different format when a condition is false.
This condition must affect to a line of a collection of articles (an article of a product list)
I have created a boolean element within a collection, however the boolean I have create is not available when I try to applicate a new condition to a field of the transacctional message.
Is there are way to use this kind of element (of a collection) as a event to be used as a condition?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @bravoga1977,
Try to create content block and reference the same in product listing to see if it works. It will look like something below,
<table>
<% for (var i =0; i < context.rtEvent.ctx.articleCollection.length; i++) { %>
<% if (context.rtEvent.ctx.articleCollection[i].articleAvailable == true) { %>
<tr>
<td>
<table>
<tbody>
<tr>
<td >
<%= context.rtEvent.ctx.articleCollection[i].articleName %>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<% } %>
<% } %>
</table>
Hi @bravoga1977,
Try to create content block and reference the same in product listing to see if it works. It will look like something below,
<table>
<% for (var i =0; i < context.rtEvent.ctx.articleCollection.length; i++) { %>
<% if (context.rtEvent.ctx.articleCollection[i].articleAvailable == true) { %>
<tr>
<td>
<table>
<tbody>
<tr>
<td >
<%= context.rtEvent.ctx.articleCollection[i].articleName %>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<% } %>
<% } %>
</table>
Hi @bravoga1977,
Was @SatheeskannaK's solution helpful to resolve your query? In case it was helpful, then kindly choose it as the 'Correct Reply'. If not and you still need more help, then do let us know.
Thanks!
Views
Replies
Total Likes
Hi @Sukrity_Wadhwa,
Well, it was not the solution I was looking for but guided me a bit on the path to follow.
Thanks!
Glad to know it helped you a bit.
Could you please share the solution with the rest of the Community as well so that it helps them too in case they are facing the same issue?
Thanks!
Views
Replies
Total Likes