Skip to main content

Discount Functions Storage: Keep Rebuy Discounts Under Shopify's 10 KB Limit

Discount Functions Storage shows how much of Shopify's 10 KB limit each Rebuy discount metafield uses and how to free up space.

Written by Tom

Use this article to check how much of Shopify's 10 KB limit your Rebuy discounts are using on the Discount Functions Storage page, find the widgets and Smart Carts taking up that space, and free up room before Rebuy discounts stop applying at checkout. It also explains the Rebuy discount storage is almost full banner in the Rebuy admin and why a widget or Bundle Builder save can be blocked by discount storage.

Why Rebuy discounts stop applying above 10 KB

Rebuy Shopify Functions discounts stop applying at checkout when the Shopify metafield that stores them grows past 10 KB (10,000 bytes). Rebuy stores the configuration of your Shopify Functions discounts in Shopify metafields, one metafield per discount family, and Shopify Functions stop reading a metafield above 10,000 bytes. When that happens, every discount stored in that metafield stops applying, including free gifts. Shopify shows no error at checkout, so the first sign is often an order charged at full price.

The 10 KB limit is set by Shopify, not Rebuy, and merchants cannot change it. Each Rebuy discount metafield has its own 10 KB limit, so one full metafield stops only the Rebuy discounts stored in that metafield.

Rebuy features that store discounts in these metafields include widget discounts (Recommended, Upsell, Add-on, Gift with Purchase, Dynamic Bundle, and checkout offers), Smart Cart Tiered Progress Bar free gifts, and Bundle Builder discounts.


Open the Discount Functions Storage page

The Discount Functions Storage page is in the Rebuy admin settings. To open the Discount Functions Storage page:

  1. In the Rebuy admin, go to Settings.

  2. Click Discount Functions Storage.

You can also click View discount storage on the Rebuy discount storage banner to go straight to the Discount Functions Storage page.

The Discount Functions Storage page is in the Rebuy admin settings, In the Rebuy admin, go to Settings,  Click Discount Functions Storage.


Read a metafield card on the Discount Functions Storage page

The Discount Functions Storage page shows one card for each Rebuy discount metafield, grouped under the Shopify discount it belongs to, such as Rebuy Product Discount. The following table lists each part of a Discount Functions Storage metafield card and what it shows.

Card element

What it shows

Metafield key

The name of the Shopify metafield, for example product-discount-widget.

Status label

How close the metafield is to the 10 KB limit. Healthy means storage is comfortably under the limit. Almost full means storage is approaching the limit and saves are still allowed. A metafield at or over the safe limit blocks any save that would add to it.

Description

Which Rebuy features use that metafield, for example 'Used by Bundle Builder discounts.'

Storage used

A bar showing the KB used out of 10.0 KB and the percentage used.

Entries

The number of widgets, Smart Carts, or flows stored in that metafield.

View Data

A control that expands the card to show the entries table and the stored JSON.

Metafield keys you can see on the Discount Functions Storage page include the following:

  • product-discount-widget, used by widget discounts (Recommended, Upsell, Add-on, Gift with Purchase, Dynamic Bundle, and checkout offers).

  • product-discount-tpb, used by Smart Cart Tiered Progress Bar free gifts.

  • product-discount-bundle-builder, used by Bundle Builder discounts.

Discount Functions Storage page, Rebuy Product Discount metafield cards showing product-discount-widget marked


Find which widgets and Smart Carts use the most discount storage

The View Data control on a Discount Functions Storage card lists every widget, Smart Cart, or flow stored in that metafield, so you can see which ones take up the most space. To see the entries in a Rebuy discount metafield:

  1. On the Discount Functions Storage page, find the card for the metafield you want to check.

  2. Click View Data.

  3. Review the Entries table. Each row shows the entry name (for example, Widget 309188), its Key, and its size in Bytes, with the largest entries listed first.

  4. Click an entry name to open that widget, Smart Cart, or flow in the Rebuy admin.

  5. Click Hide Data to collapse the card.

Below the entries table, the Stored JSON panel shows the exact data Shopify stores for that metafield. The Stored JSON panel is read-only, so you change what is stored by turning off or editing the discount in the widget or Smart Cart itself, not on the Discount Functions Storage page.

Discount Functions Storage, product-discount-widget card expanded to show the Entries table listing widgets, bytes, and the read-only Stored JSON panel with each widget's stored discount settings


Free up space in a Rebuy discount metafield

You free up space in a Rebuy discount metafield by removing the discount data of widgets and Smart Carts you no longer use, since only widgets and Smart Carts with an active discount count toward Shopify's 10 KB limit. To lower a metafield's storage used:

  1. Turn off the Discount section in each widget you no longer use, or delete the widget. Rebuy deletes that widget's discount data from the metafield as soon as its Discount section is turned off.

  2. Turn off Use Shopify Functions in each Smart Cart you no longer use, or delete that Smart Cart.

  3. Reopen the Discount Functions Storage page and confirm that the metafield's Storage used bar has dropped.

Note: Turning off a widget's live mode or setting it to Preview Mode does not remove its discount data, so a widget that is not live still counts toward Shopify's 10 KB limit while its Discount section is on.

When a Rebuy discount metafield is full and every widget stored in it is still in use, a new widget discount that would push the metafield past the limit can only be saved after you turn off the discount on another widget that uses the same metafield.


What the Rebuy discount storage banner means

The Rebuy discount storage banner is a warning at the top of Rebuy admin pages that appears when a Rebuy discount metafield is close to or over Shopify's 10 KB limit. When a metafield is approaching the limit, the banner is titled Rebuy discount storage is almost full and names how much storage that metafield uses (for example, 9.6 KB of 10.0 KB), which widget types use it, and how many entries it holds. Click View discount storage on the banner to open the Discount Functions Storage page.

The Rebuy discount storage banner appears on most Rebuy admin pages and does not appear on the Discount Functions Storage page itself.

Rebuy discount storage banner reading Rebuy discount storage is almost full, with 9.6 KB of 10.0 KB used by widget discounts across 56 entries and a View discount storage link to the Discount Functions Storage page


Why a widget or Bundle Builder save is blocked by discount storage

Rebuy blocks a save of widget settings or Bundle Builder settings when the change would push the related Rebuy discount metafield past Shopify's safe limit. When a save is blocked, Rebuy shows an error message and keeps your previously saved settings, so your live discounts keep working as they were. To save the change, free up space in that metafield as described in the section Free up space in a Rebuy discount metafield in this article, then save again.

When a widget or Bundle Builder save is allowed but the metafield is still close to or over the limit afterward, Rebuy shows a warning toast after saving. The save is kept, and the toast is a prompt to free up space on the Discount Functions Storage page.


Discount Functions Storage FAQs

Do widgets that are not live count toward Rebuy's discount storage limit?

Yes, a Rebuy widget that is not live still counts toward Shopify's 10 KB discount storage limit if its Discount section is on, because Rebuy writes the widget's discount data to the metafield when the Discount section is turned on, whether or not the widget is live. Setting a widget to draft or Preview Mode does not remove its discount data. To take the widget out of the total, turn off the Discount section inside the widget or delete the widget, since turning off the widget's live mode leaves its storage used unchanged. An unused Smart Cart with Shopify Functions still enabled also counts, until Shopify Functions is turned off in that Smart Cart or the Smart Cart is deleted.


Why is a Rebuy free gift charged full price at checkout with no error?

A Rebuy free gift can be charged full price at checkout with no error when the Rebuy discount metafield that stores the gift's discount is over Shopify's 10 KB limit, because Shopify Functions stop reading that metafield and the $0 discount never applies. Go to Settings > Discount Functions Storage in the Rebuy admin and check the card for the metafield that stores the gift, which is product-discount-widget for Gift with Purchase widgets and product-discount-tpb for Smart Cart Tiered Progress Bar free gifts. If that metafield is over the limit, turn off the Discount section on widgets you no longer use or delete unused Smart Carts until it is back under 10 KB. For other causes of a full-price gift, see Troubleshooting Gift With Purchase (GWP) and Discounting in Rebuy.

Did this answer your question?