Display Line Item Properties In Email Notification
This will go over how to add line item properties and then access them in the email notifications to display to the customer. For example, a custom sports jersey a customer orders, storing the custom name and number as line item properties.
First step is to create the line item fields. This part is optional if you are using the Bold app to create the line item properties. If not, you can visit the Shopify line item property generator here.
Once that's complete, open your order confirmation email notification template, and scroll down until you find "{{ line. title }}". You can copy and paste the code into your editor for easier access. This "{{ line.title }}" will display the products name to the customer. Underneath that h4 header, we will add our code.
{% assign propertySize = line.properties | size %} {% if propertySize > 0 %} {% for p in line.properties %} {% unless p.last == blank %} {{ p.first }} : {{ p.last }} {% endunless %} {% endfor %} {% endif %}In the first line we assign the size of our line item properties to a variable for reference. If the size is greater than zero, we loop through each line item property. We then add a break to add some space for the price and other info below. And there you have it. Displaying line item properties in your email notifications. This should work with Bold app as well as with the line item generator.