Not sure if this is the right location for this bu...
# suitecommerce
b
Not sure if this is the right location for this but since it's related to system email templates, I thought I would post here. We are attempting to rebuild the table that lists the order contents in the order received email. The trouble we are running into is that when we pull the
storedisplayname
field or a custom field, the engine always renders one of the items in the list and then repeats that value for all items. For example, with this simplified code snippet (only the essential markup/code remains).... we get the following result.... Anyone else run into this issue? Any hacks or workarounds?
Copy code
<#list salesorder.item as itemline>

<table>
  <tbody>
  <tr>

    <td><img src="${itemimages[itemline.item.internalId]}"/></td>
    <td>${itemline.item.storedisplayname}<br/>by ${itemline.item.custitem_manufacturer}
    </td>
    <td>${itemline.quantity}</td>
    <td>${itemline.amount}</td>

  </tr>
  </tbody>
</table>

</#list>
s
Hey Michael! On the face of it, it looks like a bug. However, if my memory serves me correctly,
storedisplayname
has/had issues and so isn't typically used. I am curious if this problem occurs if you try to get the item name through alternative means. Typically, there is a bit of a fandango to get it but you can do something like this to get the name:
Copy code
<#assign itemName = itemline.item?split(":")>
... [some code later] ...
${itemName[itemName?size-2]?trim}
because usually the full item name is produced based on its category structure, then you jump through some big hoops to pluck out the specific name you want from its long name
Also, just returning to your markup, do you intend to create a new table with each item loop? It's fine to do that with, say,
<tbody>
or
<tr>
but rather unusual with whole tables. Am curious as to whether some previous markup or FreeMarker stuff is tripping you up
b
Hey Steve. Definitely would agree this is a bug. In using the record browser I was able to pickup the
description
field out of the item sublist. However, any custom field just continually repeats. Regarding your parse/split solution. When we brought back the
item
property, it was only bringing back the SKU (name). As for the table, I see what you mean. Our Marketing team had used the Bronto designer and order notification integration to create the email notification, so that's where the multiple tables came from. I was porting it to a system email template as Bronto doesn't store a copy of the sent email in the ERP and that has caused some issues for our CS team.