Add line item properties to Order Confirmation

Hi,

Here is the code I added to my product-template to get Name of Attendee and their email. What code can I add to the Order Confirmation email for that info to show? I see it on the Order and Summary page but I would like it to show up in the Order Confirmation email.

Attendee's Name

Attendee's Email Address

Thanks,

LB

Hi LB:

This is possible. The code below adds the Attendee’s Name and Attendee’s Email will appear below the product title and quantity for each line item on the Order Confirmation Email.

Step 1. Open the Order Confirmation template: Settings > Notifcations > Order confirmation

Step 2. Add the following code between the selling plan name and refunded tag

{% if line.selling_plan_allocation %}
            {{ line.selling_plan_allocation.selling_plan.name }}

          {% endif %}

{%- for prop in line.properties -%}

                     
    {{ prop.first }}: 
     {{ prop.last }}  

  
{%- endfor -%}   

          {% if line.refunded_quantity > 0 %}
            Refunded
          {% endif %}

Thank you! That worked. Much appreciated!

LB

Would a similar code be needed to add custom line-item property fields to the packing slip?

@themecaster I have a similar question but I need custom line item properties to show up on the packing slip. I know where to edit the packing slip but am having a hard time with the correct coding to make it appear.

This is what I put in my Order Confirmation to make the custom inputs come in the emails:

{{ line.title }}{% for p in line.properties %}{% unless p.last == blank %} - {{ p.first }}: {{ p.last }}{% endunless %}{% endfor %}

What should I add to the packing slip to make the p line properties appear?

I believe this is the code I used. I got it to show on mine (poor memory and I forgot exactly what i did months ago), but this looks to be the correct code. Around line 133 on the packaging slip code.

{% unless line_item.properties == empty %}

    {% for property in line_item.properties %}
  • {{ property.first }}: {{ property.last }}
  • {% endfor %}
{% endunless %}

Thank you so much - I’ll try this!

@JamiCreates YOU ARE MY NEW HERO! Thanks for the help - it worked like a charm. :slightly_smiling_face:

Glad it worked! I know I searched forever for a solution! So please pass it along if you see others asking similar questions :slightly_smiling_face:

For new people finding this post, here’s a video of me editing the order confirmation email template and pasting in the code to display custom line item properties.

This is awesome!

Is there a way to only include specific line item properties? It seems by adding .first and .last includes all line item properties. We want to only include one out of the several line items on the packing slip?