Eliminate Space Between Variants on Packing Slip

Hi, all. I want my packing slips to be streamlined and only list the variants under the line item product instead of relisting the product each time. I’ve been able to eliminate the product names, but the space they were occupying is still there.

Here is my current code for this section and how it looks. Any advice on how to get rid of those big spaces? 1 hour with ChapGPT didn’t get me there :slightly_smiling_face:

Big spaces:

This is the code that eliminates the extra product names, but leaves the spaces:

{% assign previous_title = “” %}

{% for line_item in line_items_in_shipment %}

{% if line_item.title != previous_title %} {{ line_item.title }} {% endif %} {% if line_item.variant_title != blank %} {{ line_item.variant_title }} {% endif %} {% if line_item.sku != blank %} {{ line_item.sku }} {% endif %}

{{ line_item.shipping_quantity }} of {{ line_item.quantity }}

{% assign previous_title = line_item.title %} {% endfor %}

Hey @fixthisbuildtha
Kindly share your Store URL and Password if enabled also please share the link where this section is visible

This is on the packing slips when I am printing them for shipping. It’s not publicly displayed anywhere and is different for each order.

While I’m new to the Liquid language, I’m wondering if the extra line can be eliminated with whitespace control as noted in this article.

“If you don’t want any of your tags to print whitespace, as a general rule you can add hyphens to both sides of all your tags ({%- and -%})”
https://shopify.github.io/liquid/basics/whitespace/

Hopefully this helps.

Can I ask if you have you been able to get the skus to print for each item in your bundle? Are you using a specific bundle app? I came across your post while searching for the solution to this issue.