Easy Stock Buffer docs

Core concepts

How the checkout block works

Easy Stock Buffer checks each cart against your thresholds on Shopify's own servers, so the block holds on Shop Pay, Apple Pay, PayPal, and direct checkout links. Everything a shopper sees before checkout comes from the app embed in your theme.

Updated August 4, 2026

Easy Stock Buffer enforces your thresholds with a Shopify cart validation function - code that runs on Shopify's servers every time a cart is evaluated. Because it runs there and not in your theme, the block applies on every checkout path, including Shop Pay and express wallets, and the block itself needs no theme edits. What a shopper is told before they reach checkout is a separate job, and that part does live in your theme.

What it checks

For each line in the cart, the function looks up the variant's threshold and its current stock, then compares. A line is blocked when the stock left after buying it would fall below the threshold. The shopper sees a short message and cannot complete checkout until they lower the quantity or remove the item.

Where the numbers come from

The app stores each variant's threshold and a fresh stock snapshot on the variant itself. It keeps the stock snapshot current by listening for Shopify inventory updates, so the function always reads an up-to-date number. Which threshold applies follows a fixed order of precedence, covered in how thresholds decide what gets blocked.

Cart versus checkout

The block holds its message until a checkout exists, and there is a reason for that. The same message raised while the shopper is still in the cart does not warn them, it stops Shopify from opening a checkout at all, and Shopify answers that with its own plain error page that no app can restyle. Held one step later, it appears as a proper banner at the top of the checkout, in your wording, with the cart still there to fix.

So on Shopify's side nothing is said in the cart at all. The thing that warns a shopper earlier is the app embed in your theme, and it is the only thing that can: it caps a protected cart line's quantity box at what is still orderable, puts your message on that line when the shopper pushes past it, and stops the Check out button. Switch the embed off and the cart says nothing until checkout.

Why you also want the add to cart block

Checkout is the backstop, not the first thing a shopper should meet. Left to the checkout alone, a shopper can fill a cart, reach checkout, and only then be told to take items back out.

The add to cart block moves that earlier. It caps the quantity box on the product page at what is still buyable, stops an over-limit add there with your own wording before anything is sent, caps the quantity box on cart lines the same way, and stops the Check out button for a cart that has drifted over the line since. It is on every plan and takes one switch in your theme editor - see block add to cart at your threshold.

There is also an optional switch that goes a step further than stopping the shopper, Fix the cart automatically at Check out, under Settings, then Customer messages: instead of asking them to lower a line themselves, the app lowers it for them, takes out anything that cannot be ordered at all, and explains the change in your wording so their next press of Check out goes through. It is off unless you turn it on, it needs the app embed like everything else before checkout, and it changes nothing about the checkout rule itself - express wallets, Buy it now and shoppers with JavaScript off still meet the banner inside checkout.

The checkout rule has to be switched on once as well - see activate stock blocking in your Checkout settings. You can reword what shoppers see in edit the checkout messages.

What it does not cover

Checkout itself covers every case below. What these have in common is that the shopper is not warned before they get there.

  • Headless and custom storefronts. A storefront built on Shopify's Storefront API runs no theme code, so an over-limit line can be added to the cart there. It is stopped at checkout.
  • Very large carts and very large products. The theme side reads up to 250 cart lines and the first 250 variants of a product. Past those points there is no cap and no message.
  • Themes whose cart we cannot read. The quantity cap and the line message need the theme to label its cart quantity boxes in one of the ways Shopify puts in the page. Where a box cannot be matched, nothing is capped and nothing is said on that line, and the Check out button is still stopped.
  • A typed quantity in the cart. The cap stops the plus button. It does not stop someone typing a bigger number: they get your message on that line instead, and Check out is stopped.

Frequently asked questions

Does the block work with Shop Pay and express checkout?

Yes. The check runs on Shopify's servers as a cart validation, not in your theme, so it applies on Shop Pay, Apple Pay, Google Pay, PayPal, and direct checkout links - every path that reaches checkout.

Do I need to add any code to my theme?

Blocking at checkout does not need any theme code. Everything before checkout does. Shopify's side of the app says nothing while the shopper is still in the cart, on purpose, so the only thing that can warn them earlier is the Easy Stock Buffer app embed in your theme: it stops an over-limit add on the product page, caps the quantity box on cart lines, and stops the Check out button. Switch it on once under App embeds in your theme editor. It is on every plan, and without it a shopper meets your limit for the first time at checkout.

Why can a shopper still add to cart but not check out?

That is what happens when the add to cart block is not switched on. With it on, the shopper is stopped on the product page instead. Without it, the cart stays permissive so the shopper can edit it, and the order is stopped at checkout.