Your Discount Configuration Is Too Big Error
Unfortunately, Shopify Functions limits the size of metafields, which we use to store your discount configuration, to 10 kilobytes.
If you're reading this, then your discount configuration data is currently bigger than 10 kilobytes.
What is a "discount configuration"?
Our app have many available settings to let you fully customize your discount logic. However, these settings need to be stored somewhere.
Because we are using a Shopify API called Shopify Functions, which cannot access the network in public apps, we can't store these settings in a database. Instead, the settings are saved as metafields.
As mentioned here in the Shopify Functions documentation, "metafields with values exceeding 10,000 bytes in size will not be returned."
Why are you using Shopify Functions despite this limitation?
The benefit of Shopify Functions discounts is that they integrate seamlessly with the entire platform, and so they can consistently apply in the cart, checkout, and POS without requiring draft orders or other workarounds.
However, they have some several limitations, some placed by Shopify themselves.
Despite this, we believe that the benefits of Functions to merchants like you outweigh the cons.
Step 1 - Make sure to opt in to the compact format
The "Use compact format" setting greatly increases the number of products/variants/etc. you can include in a single discount.
It is no longer in beta, so you can opt in today. For new users, this setting is enabled by default, but if you've had the app for a long time, make sure to double check it's active.
In order to opt in, go to the "Settings" page, find the "Feature flags" section, check "Use compact format," and then press "Save."
Step 2 - Remove repeated conditions
If you have a logic flow with multiple branches (for example, different discounts depending on order total), you don't need to add the same "Customer has tag"/"Product is in collection" checks to every "Check if" step. Not only is that unnecessarily time-consuming, but it'll bloat your discount configuration!
Instead, take advantage of the fact that discount logic works like a "tree." If you put all the shared conditions together in their own "Check if," any child steps attached by "Then" will only apply when those conditions are met, so you don't have to repeat them. You can easily click the "Then" button before your first "Check if" and then "Check if (insert between)" to add a new one without having to erase your existing logic.
Step 3 - Reduce the number of products/collections/etc.
If your discount logic still exceeds the 10kb limit, here are some strategies you can try:
If you have a large number of products/variants/etc. to check, try using "Exclude" conditions instead, so that the overall list contained in the discount configuration is smaller.
Try creating new collections that contain products that meet the criteria for your discount. For example, you can try creating an automated collection that contains all products with specific tags.
Note that, currently, the "Specific customers" option does not have a "compact format" version, so it will lead to bigger configurations in general. If that's applying in your case, reach out to us, or considering splitting your discount up further.
Step 4 - Split it up
If your discount logic still exceeds the 10kb limit, try dividing your logic flow across multiple discounts. For example, if you have 1 discount in our app that checks for 10 different collections, try creating a 2nd one that checks for 5, and then deleting 5 collection checks from your original discount.
You can use the "Duplicate" button to copy your discount and prevent having to manually specify all products/collections/etc. again.
Note that this tactic only works for automatic discounts, not discount codes.
Step 5 - Contact us
If you're still having issues, reach out to support, and we may be able to guide you on how to further optimize your discount logic.
Have any feedback for us?
We want to hear about your experience with our app! Leave a review on the Shopify App Store.
Updated on: 29/01/2025
Thank you!