We have just migrated over to Functions from Scripts. We store all of our product discount configurations inside a single metafield, but we’ve found that after we add just a few discounts the metafield size hits a limit and the discount function stops receiving the metafield input.
This is not good for us as we do our product bundling and other discounts via the product discounts api after finding that cart transforms didn’t work for our use case. We can now only offer less than 10 discounts because of the metafield size, when previously we could do around 80 with Scripts.
Our intention here would be for you to use multiple discounts in admin to facilitate this, rather than trying to configure all your discount scenarios in a single discount. We’re aware though that the 5 automatic function discount limit might make this impractical. Are these 80 discounts all automatic, or are they code-based discounts as well?
Hey Nick,
Thanks for the reply. Our initial prototype of the app was using multiple discounts but we soon discovered the limit of 5. After the Discount Strategy of “ALL” was made available we decided this was the only way for us to achieve a large amount of discounts, as we previously thought that the metafield size limit was much higher, but found out once we’d launched that function input has it’s own limit.
All of our discounts are automatic and we set them to combine with code based discounts.
I’m currently reworking the app to reduce the size of our configurations the best I can but I fear that with the current metafield size limit we’ll still be well below what we were able to achieve with Scripts.
If you need any more information and examples of our use case let me know.
We’re also facing same issue. Any updates on it?
Not so far. We’re in a bit of a pickle.