Packing slip - alphabetical sorting for items

Topic summary

Users are seeking ways to alphabetically sort items on Shopify packing slips, particularly challenging for orders with 100+ items.

Solution Found:
Multiple users confirmed a working code modification in the packing slip template (Settings β†’ Shipping and Delivery β†’ Edit Packing Slip Template, around line 97).

Working Code:
Replace:
{% for line_item in line_items_in_shipment %}

With:
{% assign lineitems = line_items_in_shipment | sort: "title" %}
{% for line_item in lineitems %}

Additional Findings:

  • The code can be modified to sort by SKU instead of title by replacing β€œtitle” with β€œsku”
  • Browser caching may show old versions when testing; try different orders to verify changes
  • Some users reported spacing issues after implementation, with items potentially printing outside margins on multi-page slips

Unresolved Questions:

  • How to sort by additional attributes like color/Option1 Value after initial title sort
  • How to group by product type with alphabetical sorting within each group
  • How to fix increased spacing/margin issues that waste paper
Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Brilliant, thanks! This just made my day :slightly_smiling_face: