Short description of issue
Packing slips with nested cart lines
Reproduction steps
N/A
Additional info
I’m wondering if anybody has looked into nested cart lines within packing slips yet? Is it doable?
What type of topic is this
General discussion
Packing slips with nested cart lines
N/A
I’m wondering if anybody has looked into nested cart lines within packing slips yet? Is it doable?
General discussion
Hey Luke,
Great question! It doesn’t look like our packing slip variables reference mentions this yet, but you can use line_item.groups.
This is what the default template uses at the moment:
{% for line_item in line_items_in_shipment %}
<div class="flex-line-item">
<div class="flex-line-item-img">
{% if line_item.image != blank %}
<div class="aspect-ratio aspect-ratio-square" style="width: {{ desired_image_size }}px; height: {{ desired_image_size }}px;">
{{ line_item.image | img_url: effective_image_dimensions | img_tag: '', 'aspect-ratio__content' }}
</div>
{% endif %}
</div>
<div class="flex-line-item-description">
<p>
<span class="line-item-description-line">
{{ line_item.title }}
</span>
{% if line_item.variant_title != blank %}
<span class="line-item-description-line">
{{ line_item.variant_title }}
</span>
{% endif %}
{% if line_item.sku != blank %}
<span class="line-item-description-line">
{{ line_item.sku }}
</span>
{% endif %}
{% for group in line_item.groups %}
{% if group.deliverable? %}
<span class="line-item-description-line">
For: {{ group.title }}
</span>
{% else %}
<span class="line-item-description-line">
Part of: {{ group.title }}
</span>
{% endif %}
{% endfor %}
</p>
</div>
<div class="flex-line-item-quantity">
<p class="text-align-right">
{{ line_item.shipping_quantity }} of {{ line_item.quantity }}
</p>
</div>
</div>
Resulting in this:
Tried to make it look nice but found this was difficult without having a way to identify which variant a nested item belongs to ![]()
@Luke I’m working on getting our documentation updated for this. I’ll provide an update once that’s completed.