"Custom properties couldn't be included for some bundle items" - Cart Transform in POS UI

I’ve built an app that has a combination of a POS UI extension, and a Cart Transform extension. The general flow of logic is:

  • User adds a product to their cart inside the POS
  • From the cart page, the user selects the added cart line item
  • Extension appears in the cart line item details, and allows the user to add a linked product that is stored as a variant ID in a metafield. If added, a cart line item property is added to the bolt-on variant
  • Once added, the Cart Transform API bundles these together using a merge operation
  • At this point, the warning “custom properties couldn’t be included for some bundle items” appears in the POS

Despite the warning, the cart line item property is still present in the Shopify admin on the desired line when the order is processed. The products are also bundled successfully.

I contacted Support about this but they advised this was an undocumented warning and they couldn’t tell me anything about it. Is anyone here familiar with this scenario?

1 Like

Hey @jshortall , thanks for flagging this.

Definitely understand the frustration here. The fact that the properties are persisting through to the order in the admin does make it seem like the transform is going through as expected, but that warning appearing in POS is odd.

Would you be open to sharing how you’re adding the cart line item property? Are you using applyCartLinesChange in your POS UI extension, or is it being added another way?

If you’re open to sharing a snippet of your Cart Transform merge operation that would be super helpful as well, so we can see how we’re bundling the items together I’m also curious if the warning appears consistently, or only in certain scenarios (e.g., specific products, certain property values, etc.)? And is the warning purely visual, or is it affecting any functionality from the merchant’s perspective beyond just seeing the message?

If you’re comfortable sharing your store domain (or a development store where this is happening), that could also help us dig into logs and see what’s going on under the hood. Hope to hear from you soon, happy to dig into this further for sure.

Hi @Alan_G,

The warning seems purely visual, and happens every time a bundle is created with this operation. In my POS UI extension, I’m using api.cart.addLineItemProperties to add the property. My dev store is https://pos-ui-extension-dev.myshopify.com/

Here’s my Cart Transform function:

const NO_CHANGES = {
    operations: [],
};

export function cartTransformRun(input) {
    const posAttribute = input?.cart?.attribute;
    if (
        !posAttribute ||
        posAttribute.key !== "[redacted]" ||
        posAttribute.value !== "true"
    ) {
        return NO_CHANGES;
    }

    const operations = [];
    const cartLines = input.cart.lines;

    const variantIdToLine = {};
    for (const line of cartLines) {
        if (line.merchandise.__typename === "ProductVariant") {
            variantIdToLine[line.merchandise.id] = line;
        }
    }

    const mergedPairs = new Set();
    for (const line of cartLines) {
        const associateProductAttr = line.associate_product;

        if (associateProductAttr && associateProductAttr.value) {
            const associateProductGid = `gid://shopify/ProductVariant/${associateProductAttr.value}`;
            const associatedLine = variantIdToLine[associateProductGid];

            if (associatedLine) {
                const pairKey = [line.id, associatedLine.id].sort().join("|");

                if (!mergedPairs.has(pairKey)) {
                    mergedPairs.add(pairKey);

                    operations.push({
                        linesMerge: {
                            cartLines: [
                                {
                                    cartLineId: line.id,
                                    quantity: 1,
                                },
                                {
                                    cartLineId: associatedLine.id,
                                    quantity: 1,
                                },
                            ],
                            parentVariantId: associatedLine.merchandise.id,
                            title: `${associatedLine.merchandise.product.title} title`,
                        },
                    });
                }
            }
        }
    }

    return operations.length > 0 ? { operations } : NO_CHANGES;
}

Thanks for sending this my way @jshortall, really appreciate it. Your Function code itself looks fine from what I can tell, not seeing anything there that would would drop properties.

I’d like to see if we’re able to reproduce it on our side here. Would you be open to sharing the full run.graphql input query from the Cart Transform extension, especially the part where you select the associate product value. To confirm, are you selecting it with line.attribute(key: “associate_product”) on each cart line?

If you’re open to sharing that, I can try to run the same selection and see what POS is doing on our end. Feel free to redact anything sensitive as well. Speak soon, we’ll get this looked into :slight_smile:

Hi @Alan_G, thanks for taking a look. Please see below.

query CartTransformRunInput {
    cart {
        lines {
            id
            quantity
            merchandise {
                __typename
                ... on ProductVariant {
                    id
                    title
                    product {
                        title
                    }
                }
            }
            associate_product: attribute(key: "_associate_product") {
                value
            }
        }
        attribute(key: "[redacted]") {
            key
            value
        }
    }
}

FYI: the redacted key is equal to the redacted key in my Cart Transform function.

Thanks for this @jshortall , I’ll keep digging into this on our end and loop back with you once I have next steps/an answer.

Hi @Alan_G, just wondered if you’ve had any success recreating this issue?

Hey @jshortall - thanks for following up. We’re still looking into this on our end here, but there’s been a bit of movement! I’ll keep you up to date in the thread here once I have more to share :slight_smile:

Hey @jshortall , following up on this, we have identified this as a potential bug on our end and are working on a fix. I can’t guarantee a turnaround time, but we’ve added it to our to-do list. I’ll keep you updated!