When I edit an order on Shopify by removing items, the removed items don't show on the packing slip, but their price is still calculated as if they are still part of the order. I've found a way to prevent this when only one item has been removed:
{% unless includes_all_line_items_in_order %}
{% assign removed_item = order.subtotal_line_items | last %}
{% assign modified_subtotal = order.subtotal_price | minus: removed_item.final_price %}
{% assign modified_total = order.total_price | minus: removed_item.final_price %}
{% endunless %}
<div class="price-info text-align-right">
<p>
<span class="subtitle-bold to-uppercase">Sub Total:
</span>
<span>
{% unless includes_all_line_items_in_order %}
{{modified_subtotal | money}}
{% else %}
{{order.subtotal_price | money}}
{% endunless %}
</span>
</p>
</div>
<div class="price-info text-align-right">
<p>
<span class="subtitle-bold to-uppercase">Shipping:
</span>
<span> {{order.shipping_price | money}}</span>
</p>
</div>
<div class="price-info text-align-right">
<p>
<span class="subtitle-bold to-uppercase">Total Paid: </span>
<span>
{% unless includes_all_line_items_in_order %}
{{modified_total | money}}
{% else %}
{{order.total_price | money}}
{% endunless %}
</span>
</p>
</div>
</div>
Is there a way to target all removed items on an order, so I can make this work for when multiple items are removed?
Thank you!