Blocking Shopify checkout by state, as code you own
Willie’s Remedy sell hemp-derived wellness products, and the rules for what can ship where vary from one US state to another. Some products simply can’t be sent to some states, and enforcing that is the store’s responsibility, not something a customer should be expected to know. The usual route is a state-restriction app, which is a monthly fee and another thing sitting in the checkout path.
What we did
We built it as a Shopify Function, checkout validation that runs inside Shopify’s own checkout and belongs to Willie’s outright. When a cart holds a product that can’t ship to the address at checkout, the order is stopped right there with a clear message, before payment, rather than being caught later by a person. Which products are restricted, and which states, is data the team control, so a rule change is an edit rather than a developer ticket. And it fails safe, so if anything ever looks unusual it won’t block a legitimate order by mistake.
The result
Restricted products can’t be checked out to states they can’t ship to, enforced automatically on every order, with no monthly app and nobody else on the critical path. When the rules change, and in this category they do, that’s a change Willie’s make to their own configuration.
What to take from it
If your business has real rules about who can buy what, or where it can go, that logic belongs in checkout where it actually gets enforced, not in a line on the product page hoping people read it. It’s worth knowing whether the thing enforcing your rules is code you control or an app you rent, because when the rule is a legal one you don’t want it depending on someone else’s roadmap.