Order confirmation email shows nested cart line items twice

When using parent_id in /cart/add.js to create nested cart lines (e.g., a main product with a free gift nested underneath), the default order confirmation email renders the parent line item twice:

  1. Once as a standalone item in the subtotal_line_items loop (because line.groups.size == 0 and it’s not a nested_line_child?)
  2. Once as a deliverable group in the line_item_groups loop (with its children correctly shown underneath)

The subtotal/total calculations are correct — only the visual display is duplicated.

Steps to reproduce:

  1. Add items to cart via /cart/add.js with a parent_id field on one of the items, creating a parent-child nested line relationship:
  {
    "items": [
      { "id": 1234, "quantity": 2 },
      { "id": 5678, "quantity": 1, "parent_id": 1234 }
    ]
  }
  1. Complete checkout
  2. View the order confirmation email

Expected: The parent item appears once, with its child item nested underneath.

Actual: The parent item appears twice — once standalone (without children) and once with children nested underneath.

Checkout

Email

Could anyone have a look please? We are getting tickets from confused merchants daily but would like to keep using the new nested cart lines.

Hey @dostu, thanks for reporting this.

I was able to replicate this on my test store as well. I’m looking in to this and will report back here with what I find.

Hey @dostu, following up here, our team is looking in to this. I don’t have a timeframe on a resolution, but I will update here with any changes.

Any updates on this? We are constantly getting tickets from our merchants about this.

The issue seems to be that nested_line_parent? and nested_line_child? never fire for parent_id-nested items.

I have checked and the issue is still open, although not resolved. We are tracking this and will update when there is a resolution.

In the meantime, have you implemented any workarounds? For example updating the template?

@KyleG-Shopify We’re facing the same issue. As a temporary workaround, we’ll turn off this feature. In the meantime, we hope you can resolve it.

@KyleG-Shopify any progress on this topic? I tried a couple of days ago and it was still an issue.

@KyleG-Shopify Is there any progress on this matter? my client is facing the same issue today.

Hey all, thanks for checking in. This is currently not yet resolved.