It doesn't work because $lineItem
is not set in the template, you'll have to loop thorough $contribtuions
and use the API:
{foreach from=$contributions item=contribution}
{crmAPI var='result' entity='LineItem' action='get' contribution_id=$contribution.id}
{foreach from=$result.values item=lineitem}
{$lineitem.label} // Price field label
{/foreach}
{/foreach}
Please note: this works fine generating ThankYou's with one contribution per individual.
Related topics for more details:
- How can I use custom tokens when grouping Thank You lettersHow can I use custom tokens when grouping Thank You letters
- Contribution Note Smarty VariableContribution Note Smarty Variable
Let me know if that helps.