Make Shipping/Insurance be Listed last in Checkout and Order Confirmation

EC23
Excursionist
19 1 4

Is there code to help to rearrange how shipping/insurance is listed at Checkout and on the Order Confirmation email?

 

Please see screenshots, I would like "Route Protection" to be listed last if a customer applies it to an order.

 

 

Screenshot 2024-01-07 at 6.29.09 PM.png

Screenshot 2024-01-07 at 6.29.39 PM.png

  

  

Replies 2 (2)

Dascalargo
Shopify Partner
62 6 28

Not sure about the cart, but I had to do something similar for a packing list. I'm guessing the same approach would work for a confirmation.

 

Add an unless statement inside your for loop for the line items. So, for example:

 

{% for line in subtotal_line_items %}
{% unless line.product.title == 'Route Package Protection' %}
.
. (all the line item stuff in here)
.
{% endunless %}
{% endfor %}

You can then duplicate that whole for loop, but replace the unless with an if.

 

The first for loop will list every item except for your Route Package Protection, and the second for loop will list only occurrences of Route Package Protection.

 

Make sense?

EC23
Excursionist
19 1 4

@Abdosamer can you also help me with this one?