Shopify themes, liquid, logos, and UX
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 🙂
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 %}
<div class="flex-line-item">
<div class="flex-line-item-description">
<p>
{% if line_item.title != previous_title %}
<span class="line-item-description-line">
<strong>{{ line_item.title }}</strong>
</span>
{% endif %}
{% 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 %}
</p>
</div>
<div class="flex-line-item-quantity">
<p class="text-align-right">
{{ line_item.shipping_quantity }} of {{ line_item.quantity }}
</p>
</div>
</div>
{% 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.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024