Skip to content

Instantly share code, notes, and snippets.

@basilkhan05
Last active Jun 14, 2022
Embed
What would you like to do?
{% assign inventory_batches = order.metafields.freshly.inventory_batches %}
{% for inventory_batch in inventory_batches %}
{% if line_item.sku != blank and line_item.sku == inventory_batch.sku %}
<p>
<strong class="item-description-line">
{{ inventory_batch.batch_name }}
</strong>
<span class="item-description-line">
Location: {{ inventory_batch.location_name }}
</span>
<span class="item-description-line">
Expiry date: {{ inventory_batch.expiry_date | date: "%b %d, %Y" }}
</span>
<span class="item-description-line">
Received date: {{ inventory_batch.received_date | date: "%b %d, %Y" }}
</span>
{% unless inventory_batch.batch_number == blank %}
<span class="item-description-line">
Batch number: {{ inventory_batch.batch_number }}
</span>
{% endunless %} {% unless inventory_batch.barcode == blank %}
<span class="item-description-line">
Barcode: {{ inventory_batch.barcode }}
</span>
{% endunless %}
{% unless inventory_batch.invoice_number == blank %}
<span class="item-description-line">
Invoice number: {{ inventory_batch.invoice_number }}
</span>
{% endunless %}
{% unless inventory_batch.description == blank %}
<span class="item-description-line">
Description: {{ inventory_batch.description }}
</span>
{% endunless %}
</p>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment