Cart item with same id showing up multiple times instead of quantity

Topic summary

Issue: Adding the same product results in multiple cart line items instead of a single item with increased quantity. /cart.js shows items sharing the same id, but the Liquid loop (“{% for item in cart.items %}”) renders duplicates each with quantity 1.

Key insight: Shopify groups items by variant id only when their line item properties are identical. If properties differ (e.g., personalization inputs, hidden fields, timestamps), Shopify will automatically split them into separate lines, even with the same id.

Action items:

  • Inspect item.properties in /cart.js and in cart.items to verify any differences.
  • Remove or standardize any non-essential properties so identical items can merge into a single line with higher quantity.
  • Review customizations or apps that may be injecting unique property values.

Status: No confirmed resolution yet. The working hypothesis is differing line item properties causing the split; the Liquid loop itself is not the issue.

Summarized with AI on December 23. AI used: gpt-5.

Whenever I’m adding the same item to a cart on my store, the item is appearing as multiple line items in the cart instead of grouping by the quantity of the item. When inspecting the returned json from /cart.js the objects in the returned items array have the same ids but are not grouping together in this loop:

{% for item in cart.items %}

{% endfor %}

It is instead just showing the same item but with quantity of 1

@djpoodleemoji check properties, if they are different Shopify will split automatically.