Line Item Properties Missing Following Cart Transform Expand Operation

I believe this is a topic that has been discussed elsewhere before, but I wanted to create another discussion here for additional visibility.

Issue:

Line item properties are removed from expanded products when creating Expand Operations via the Cart Transform Function API. This can potentially break the functionality of any app implementing cart transforms and/or break compatibility with 3rd party apps that add line item properties.

Example:

  • A product with a “delivery-date” line item property is expanded to include an upsell via the Cart Transform API. Following the function run, the “delivery-date” continues to appear on the product in the checkout.

  • Following checkout, the “delivery-date” line item property has not persisted through to the order data and the properties array for the product is empty.

Summary:

I would be surprised if this is intended behaviour and imagine this is a dealbreaker for many app developers looking to implement Cart Transforms.

The ability to add line item properties using Cart Transforms was added in the 2024-04 API version:

However, this is does not help when line item properties are created with dynamic keys and does not solve the issue of cross-app compatibility.

If anyone has discovered a work around for this in the meantime I would love to hear it! :grin:

1 Like

Yes. This is correct. Right now, the line item properties on the parent bundle product are not visible on the Shopify admin. It would be good if those are accessible in the admin.

That being said, those properties can still be accessed and queried via the GraphQL API.
These properties are available on lineItemGroupcustomAttributes:

Link to GraphQL Object: https://shopify.dev/docs/api/admin-graphql/2024-10/objects/LineItemGroup#field-customattributes

3 Likes

Awesome, did not realize the properties were accessible this way. Thanks!

Do the customAttributes still have a reference to the product/products they belong to?

Each of the lineItems that make up the cart transform “bundle” will have the lineItemGroup field present, which can be accessed to get the customAttributes.

In the lineItemGroup, the variantId and variantSku fields can also be accessed to determine the product variant that acted as the “parent” line item for the bundle. In the expand cart operation, that would be the variant used in the “cartLineId” field (ExpandOperation).

That being said, this is still an issue for our team as it goes against the convention of using line item properties for line item-level data capture and negatively impacts many post-order processes. For example, Shopify’s own Order Printer app is unable to access the custom attributes of line item groups and becomes basically unusable for many use cases.