The right liquid variable for location on New Order Template

MacNusPro
New Member
2 0 0

Hi there!

At the moment I'm struggling with tweaking the New Order notification template to my needs.

For now I've referred to these resources: 

https://help.shopify.com/en/manual/orders/notifications/email-variables

https://shopify.dev/api/admin/rest/reference/inventory/location#

Skærmbillede 2021-07-06 kl. 10.19.29.png

Most important of all, I need to include which location each product has been sold from. (Since this store has multiple locations)

The info shows on the order page in Shopify on the product level so I know I must be a liquid variable of some kind. 

I've tried both location.id & location.name - but nothing seems to even show up on the order template. 

 

This is what the code looks like at the moment in that section of the template (I've only adjusted the last 6 lines of code) 

<table class="row">
{% for line in subtotal_line_items %}
<tr class="order-list__item">
<td class="order-list__item__cell">
<table>
<td>
{% if line.image %}
<img src="{{ line | img_url: 'compact_cropped' }}" align="left" width="60" height="60" class="order-list__product-image"/>
{% endif %}
</td>
<td class="order-list__product-description-cell">
{% if line.quantity < line.quantity %}
{% capture line_display %} {{ line.quantity }} of {{ line.quantity }} {% endcapture %}
{% else %}
{% assign line_display = line.quantity %}
{% endif %}

<span class="order-list__item-title">
{% if line.product.title == blank %}
{{ line.title }}</span><br/>
{% else %}
{{ line.product.title }}
{% endif %}

{% if location.id == blank %}
{{ location.id }}</span><br/>
{% else %}
{{ location.id }}
{% endif %}
</span><br/>

 

The crucial information I need is the info of either warehouse 1 or 2, to be shown on the individual product. 

Refer to this image below:

Skærmbillede 2021-07-01 kl. 13.42.24 2.png

 

I really hope one of you in the community can help me out tweaking this code.

 

Otherwise I'm open to whatever can fix this issue. Maybe it's not the order notifications I should use - but something totally different.

Best regards,

Magnus 

0 Likes