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

7 Likes

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.

1 Like

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.

1 Like