Hi,
in the notes of a product I have different lines, each line begins with a dash (‘-’). In my template for the invoice I would like to generate in the product table different list items from the notes by using the split function in twig as follows:
<td>
<p>{{ item.product_key }}</p>
<ul>
{% set temp_notes = item.notes|split('-') %}
{% for note in temp_notes %}
<li> {{ note }} </li>
{% endfor %}
</ul>
</td>
But for some reason the split function does not work. It seems like
{% set temp_notes = item.notes|split('-') %}
returns nothing. The dash ist not the problem. I also tried different characters to seperat.I also tried
{% set temp_notes = item.notes|split('') %}
which should result in a separation after every character. But again the split returns nothing.
Any ideas or hints?