What's your biggest current challenge? Have your say in Community Polls along the right column.

How can I sort items in sequence by SKU number?

How can I sort items in sequence by SKU number?

Planetofsweets
Tourist
11 0 3

Hello! 
I am experiencing a huge problem picking orders.

Who can advise or how can I make that all SKU numbers would be in  a sequence , because all my stock is sorted by locations. 

Otherwise this chaos makes me run up and down , to one warehouse corner to another to pick items in the box. 

 

To make it clear I will add a screenshot.

 

Screenshot 2021-04-01 at 23.43.15.png

I need SKU's to go  in order.

 

1; 2; 3; 4; ..... 52, 56, 101, 245, 356, etc

 

 

If someone could help me with this I would highly appreciate! 

 

 

Thank you! 

Replies 5 (5)

beercrush
Visitor
1 0 0

You can add the below line of code

{% assign line_items_in_shipment = line_items_in_shipment | sort: "sku" %}

 

in the packing slip template above

{% for line_item in line_items_in_shipment %}

 

Go to Settings > Shipping & Delivery > Edit packing slip template

 

 

SweetGemLife
Visitor
1 0 0

Is there an exact location in the code where this line of code should be added?

SecondStoryCard
Tourist
3 0 5

In your packing slip template, find the line:

{% for line_item in line_items_in_shipment %}

 

For me it was line 100...but yours will vary depending on which template you are using. 

 

 

When you find that, you want to replace it with 

 

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

 

Once you make the change, be sure to save it. If you still don't see the change working, perhaps trying logging out and back in again to see if that resets it and allows the change to take place. 

BenW1
Visitor
1 0 0

Worked for me, awesome, thank you

kshreddy
Shopify Partner
1 0 0

I was looking for the same thing to have SKUs listed in order without using an outside app. This worked great! Thanks!