Shopify Scripts vs Shopify functions

Hi all! We are migrating Shopify Scripts to Shopify Functions. We have the following case:

We have a product in the cart with different quantities. We want to split this product into groups of 3 items each. Previously, we used cart.line_items.insert in the script. Now, the most suitable approach is the Cart Transform function, where we can create bundles of 3 items by merging line_items.

Is there any other way to modify this, or is Cart Transform the only option?

Hi @AndreyFourmeta :waving_hand: :rescue_worker_s_helmet: Also see these discussions

https://community.shopify.dev/t/function-to-add-remove-products-from-cart/13443

https://github.com/Shopify/function-examples/discussions/213

In some scenerios notice the update function, only for stores on shopify Plus, lets you set the price,title, and image so could serve as a way to reframe an item in the checkout :bomb: but notice this doesn’t change the actual items properties like SKU,etc.