Line items in customer confirmation emails not showing

Highlighted
Tourist
9 0 0

I'm having trouble getting the custom line items to show up in the emails sent to the customers.

This is the code I've used...

 

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

taken from here https://help.shopify.com/en/themes/customization/products/features/get-customization-information-for...

 

I've also tried this...

{% unless line_item.properties == empty %}
<ul>
  {% for property in line_item.properties %}
  <li>{{ property.first }}: {{ property.last }}</li>
  {% endfor %}
</ul>
{% endunless %}

taken from here https://help.shopify.com/en/themes/liquid/objects/line_item#line_item-properties

 

Neither one works for me in the order confirmation or new order emails.

Any help would be appreciated. Thanks

0 Likes
Highlighted

Hello 

What you get in output after running refered code.

Want to modify or incorporate custom changes on store, Hire us
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Whats app
Free Website Review and advice for sale from Shopify Conversion Experts | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Shopify SEO ; Digital Marketing & amp | Site Speed Optimization | Performance Site Audit
0 Likes
Highlighted
Tourist
9 0 0

I get no output, that's what is so strange.  I did get the {{ line.title }} to appear on a email preview but thats it.  I'm using shopify's free narrative theme if that helps at all.  Thanks for any help you can provide.

0 Likes
Highlighted
Tourist
9 0 0

Hi

 

 

0 Likes
Highlighted
Excursionist
46 0 6

I would be also interested as I'm facing the same issue (cf my topic here https://community.shopify.com/c/Shopify-Design/Product-customization-texte-image-upload-can-t-retrie...)

0 Likes
Shopify Partner
17 3 3

Hi @BVPark,

You can add this code to hopefully solve.

{%- assign property_size = item.properties | size -%}
                {% if property_size > 0 %}
                  <div class="cart__meta-text">
                    {% for p in item.properties %}
                      {% unless p.last == blank %}
                        {{ p.first }}:

                        {% comment %}
                          Check if there was an uploaded file associated
                        {% endcomment %}
                        {% if p.last contains '/uploads/' %}
                          <a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
                        {% else %}
                          {{ p.last }}
                        {% endif %}
                      {% endunless %}
                    {% endfor %}
                  </div>
                {% endif %}

Thank you

KoderWeb
Want to modify or custom changes on store hire us.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!

Email: mdraselhossain69@gmail.com
Shopify Expert | Shopify Designer | Shopify Developer
0 Likes
Highlighted
Shopify Partner
6 0 2

Still not working. I tried all above mentioned code. Any help or solution. 

0 Likes
Highlighted
Shopify Partner
6 0 2

Hey guys,

 

I just solved it. If anyone need a solution to this, you can dm me or send me the mail.

0 Likes
Highlighted
Excursionist
46 0 6

Hey @harshchudasama , glad that you solved it :)

 

You might want to share it as well here so that anyone who comes here can find the solution easily ;)

 

Thanks

0 Likes
Highlighted
Shopify Partner
6 0 2

It wasn't working, because the line item properties returns array and in new mail format shopify changed some little thing. line.tittle was saved in some variable, so when you replace {{line.tittle}} with any code, it won't work. You have to paste the code in variable. 

0 Likes