We have a bundles app that uses a Cart Transform function to merge individual products into bundles.
In the function input we fetch each cart line’s variant and its parent product. For a combined listing, the parent we get back references the child product rather than the combined listing product. As a result, a bundle that’s configured to include the combined listing product is not detected, and the merge doesn’t happen.
Is there any way, from within a Cart Transform function, to tell that a variant belongs to a combined listing, or to resolve its combined listing parent? The Product input type doesn’t expose combinedListingRole or any parent reference like the Admin API does.
If it’s not currently possible, is exposing combinedListingRole (or the parent reference) on the Product type in the Functions input schema something that could be considered?
Hey @Anton! I had a look and you’re reading the Cart Transform input correctly. There is no combinedListingRole, combinedListing, or a parent product reference exposed on the Functions Product type in the current Cart Transform API.
As a result there’s currently no direct way for the Cart Transform function to resolve the Combined Listing parent from ProductVariant.product.
For now, a practical approach is to make the bundle matching data use the child products or variants. If your app still needs to treat those child products as belonging to a Combined Listing parent, you would need to build that mapping outside the Function using Admin GraphQL, then expose it to the Function through something it can read in its input query, such as app-owned metafields or metaobjects.
This seems like a reasonable gap to raise as a feature request, since Admin GraphQL has the CombinedListing relationship fields but the Functions input schema does not currently expose them so I’ve logged one internally - thanks for raising this!