Ability to add more than one Cart Transform Function per app per store?

I’d like to raise a discussion about a current limitation with Cart Transform Functions that’s affecting app performance and scalability.

Current Situation:

  • Each app is limited to ONE Cart Transform Function per store
  • This means all app features requiring cart modifications must be handled by this single function
  • In our case, we’re building a bundling solution that relies heavily on line item properties

The Challenge: Our app needs to read multiple line item properties to properly handle product bundling. Because we’re forced to include all our logic in a single Cart Transform Function, we’re seeing increasing query costs as we need to:

  1. Read all bundle-related properties for every cart modification
  2. Process multiple features through the same function
  3. Handle various bundling scenarios in one code block

Proposed Solution: If apps could implement multiple Cart Transform Functions per store, we could:

  • Split different bundling features into separate functions
  • Distribute the property reading across multiple functions
  • Only query the specific properties needed for each particular feature
  • Better organize and maintain our code
  • Potentially reduce the overall query cost by making each function more focused

This would lead to:

  • More efficient resource usage
  • Better code organization
  • Reduced query costs
  • Improved maintainability

Has anyone else encountered similar challenges? How are you handling complex cart modifications within the single function limitation?

Looking forward to your thoughts and any potential workarounds you might have discovered. :smiley:

8 Likes

This makes a lot of sense. Is this because the ordering of running multiple cart transforms then becomes an issue?

What currently happens if you install two applications with cart transforms? Are they run in parallel or sequentially?

2 Likes

Not sure about the behaviour. We know Cart Transform run before discounts functions. Usually, different apps have control over different products so there is less overlap.

But I know this was in the roadmap because there is a GraphQL API for listing Cart Transform Functions.

1 Like