Cart transform Merge operation for create bundle products having issue with line items.

Topic summary

A developer is implementing cart transform bundle operations on a Shopify Plus checkout page but encountering a critical issue: while the bundle merge operation executes, the main product line item remains visible as a separate entry instead of being removed and consolidated with the child item.

The Problem:

  • Main product: ‘10 things I love’ Personalised Scratch Card Kit
  • Gift product to merge: Gift Sleeve
  • The merged bundle displays correctly, but the original main product line item persists on checkout
  • Pricing appears to come from the child (gift) item rather than combining properly

Technical Details:
The developer has shared their cart transform input JSON showing the cart lines and merge operations structure. The merge operation configuration appears correct based on their review, with proper parent variant IDs and cart line references.

Current Status:
Another user (KetanKumar) has offered to investigate the issue and provide a solution, requesting the site URL to examine the implementation further. The discussion remains open awaiting troubleshooting assistance.

Summarized with AI on November 3. AI used: claude-sonnet-4-5-20250929.

Hello,

Based on my custom conditions for the product, I have just worked with Bundle items to be displayed.

In the checkout page, the Bundle items function partially works, but the Main product is still displayed separately, and we want it to merge with the child item.

  • Main Product: 10 things I love’ Personalised Scratch Card Kit
  • Merge gift product: Gift Sleeve.

I have issue on the checkout page, Cart transform bundle operation works but main product line item is not removed from the checkout page.

Cart transform input:

{
  "cart": {
    "lines": [
      {
        "id": "gid://shopify/CartLine/5e9e6834-5cc2-43dc-a5d0-2c13f172754f",
        "quantity": 1,
        "cost": {
          "amountPerQuantity": {
            "amount": "5.0"
          }
        },
        "merchandise": {
          "id": "gid://shopify/ProductVariant/46124831899893",
          "sku": "GIFTSLEEVE1",
          "__typename": "ProductVariant",
          "product": {
            "id": "gid://shopify/Product/8916674347253",
            "title": "Gift Sleeve",
            "giftWrap": null,
            "giftSleeve": null
          }
        }
      },
      {
        "id": "gid://shopify/CartLine/cf389645-f3a6-4f7d-b709-ec2e89e405a6",
        "quantity": 1,
        "cost": {
          "amountPerQuantity": {
            "amount": "11.0"
          }
        },
        "merchandise": {
          "id": "gid://shopify/ProductVariant/46119626408181",
          "sku": "",
          "__typename": "ProductVariant",
          "product": {
            "id": "gid://shopify/Product/8916687257845",
            "title": "10 things I love' Personalised Scratch Card Kit",
            "giftWrap": {
              "value": "true"
            },
            "giftSleeve": {
              "value": "[\"gid://shopify/Product/8916674347253\"]"
            }
          }
        }
      }
    ]
  }
}

Also Merge Operation looks correct for me,

{
  "operations": [
    {
      "merge": {
        "cartLines": [
          {
            "cartLineId": "gid://shopify/CartLine/5e9e6834-5cc2-43dc-a5d0-2c13f172754f",
            "quantity": 1
          }
        ],
        "parentVariantId": "gid://shopify/ProductVariant/46119626408181"
      }
    }
  ]
}

But when we check the checkout page, Main product still displayed


as a separate line item. Also, Merge operation seems to be displayed but their price is from the child (gift item) item.

How to remove the main product line item and display it as merged with gift items and update the price with the merged item.

Let me know any changes are required from my end to fix this.

Thank you.

1 Like

@rb_ayko

Sorry you are facing this issue,
It would be my pleasure to help you.
Please share your site URL,
I will check out the issue and provide you with a solution here.