Show gifts in order emails
A gift from Unlock Bar is a normal product line at €0. The admin order and every document (invoice, delivery note) mark it as Free gift · Unlocked at €80 on their own. The order confirmation email does not: it is your template, and Unlock Bar never edits it.
To mark gifts there too, paste one snippet into your template. You can remove it at any time.
Paste the snippet
Open Settings → Shop → Email templates and edit Order confirmation. If your flows send more than one order confirmation template, repeat these steps for each.
In the Mail text card, find the product name in the HTML field. In Shopware's default template it is this line, followed by a closing
</div>:twig{{ nestedItem.label|u.wordwrap(80) }}Paste this directly after that
</div>:twig{% if nestedItem.payload.ssdCpbGiftMilestoneId is defined %} <div>{{ 'ssdUnlockBar.gift.badge'|trans|striptags }} · {{ 'ssdUnlockBar.gift.lineMetaWithoutValue'|trans({ '%threshold%': nestedItem.payload.ssdCpbGiftThreshold|currency(currencyIsoCode) })|striptags }}</div> {% endif %}In the Plain text field, find this line:
twigDescription {{ lineItem.label|u.wordwrap(80) }},Paste this directly below it:
twig{% if lineItem.payload.ssdCpbGiftMilestoneId is defined %} {{ 'ssdUnlockBar.gift.badge'|trans|striptags }} · {{ 'ssdUnlockBar.gift.lineMetaWithoutValue'|trans({ '%threshold%': lineItem.payload.ssdCpbGiftThreshold|currency(currencyIsoCode) })|striptags }}, {% endif %}Save.
The HTML field uses nestedItem and the plain text field uses lineItem, because Shopware's default template names the line differently in each. If you built your own template, use the name your product loop gives each line.
What the customer sees
Mini Lipstick
Free gift · Unlocked at €80.00
1 × €0.00Only gift lines get the extra line. Every other line stays as it was.
Language and wording
The text comes from the same snippets as the storefront, in the language of the order: "Free gift · Unlocked at €80.00" in English, "Gratisgeschenk · Freigeschaltet ab 80,00 €" in German. Change the wording under Settings → Shop → Snippets (ssdUnlockBar.gift.badge and ssdUnlockBar.gift.lineMetaWithoutValue), and the email follows.
Check the result with a real test order. The template preview doesn't load your shop's snippets, so it can show the wrong language.
Remove it
Delete the pasted lines and save. Do this too before you uninstall Unlock Bar.
