Line item properties from book that app in confirmation email

Line item properties from book that app in confirmation email

KCB613
Visitor
1 0 0

I am using Book That App (BTA) on my store for customers to select the dates that they'd like for the services we offer. The dates are stored in line properties and I can see them when I export the order using Matrixify so I sure they are there.

 

When I try to have the dates appear on the confirmation email, they do not appear.

 

Here is the code I've tried without success.

 

{% assign propertySize = item.properties | size %}
{% if propertySize > 0 %}
{% for p in item.properties %}
{% assign first_character_in_key = p.first | truncate: 1, '' %}
{% unless p.last == blank or first_character_in_key == '_' %}
<br>
{{ 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 %}
{% endif %}

 

I have also tried the following code, also without success

 

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

 

any ideas what's going on? 

Reply 1 (1)

Gavinator
Shopify Partner
1318 15 124

It's a pity the line item properties are not included by default in the order confirmation email template. We get so many people who have problems setting it up, as I'm sure every other App that uses them will attest to, and Shopify support just throws it over to us even though they are a standard feature of the Shopify platform. (We have requested this several times through various channels, over several years, but no joy).

 

Anyhoo...

 

I'd recommend checking the name of the line_item variable. We commonly see line, line_item and item being used. In your example code you used 2 different variables (line_item and item).

 

To find out what is being used, look for the code in the confirmation template that reads something like this: {% for line in subtotal_line_items %}. In this case it is using line, so the following code will display the line item properties:

 

{% for p in line.properties %}
<br>{{ p.first }}: {{ p.last }}
{% endfor %}

 

 

HTH, Gavin.

www.bookthatapp.com