Updated October 2026
Short answer: There are two causes. Either the discount code isn't set to combine with shipping discounts, or it takes the cart below your free shipping threshold. Shopify's free shipping discount always counts its minimum after combined discounts. In RM: Advanced Free Shipping, you can choose: Cart subtotal counts the cart before discounts, so a code can't push customers under the threshold.
Shopify only applies two discounts to the same order when both allow it:
The code: in Shopify admin, go to Discounts, open the code, and under Combinations tick Shipping discounts.
The shipping discount: under Combinations, Product discounts and Order discounts must be ticked. In the app, both are ticked by default.

If either side isn't ticked, the customer gets only one of the two. Codes created by other apps (email, loyalty, wholesale) need the same setting. See Combining with other discounts.
Example: free shipping over $100. A customer has $110 in the cart and uses a 20% off code, so the cart is now $88.
Shopify's free shipping discount counts the minimum purchase at the discounted price, so the customer loses free shipping. There's no setting to count it before discounts.
A free rate in Shipping and delivery with a minimum order amount also uses the discounted value.
Cart subtotal Is at least 100 counts the cart before discounts. The $110 cart with 20% off still gets free shipping.
Cart total Is at least 100 counts the cart after product and order discounts. The same cart, now $88, doesn't.

If only some products should count, Cost of items from collection (subtotal) and (total) work the same way. See Cart total and cart subtotal.
Some stores want the opposite: no free shipping on top of another discount.
Never together: in your shipping discount, untick Product discounts and Order discounts under Combinations. Customers using another discount pay normal shipping.
Only if they still spend enough: keep combining on and use Cart total, so free shipping applies only when the cart is still over the threshold after the code.
This only works when the free shipping is a discount. A free rate set up in Settings → Shipping and delivery always shows, whatever codes are used.
Shipping never counts toward Cart total or Cart subtotal.
Compare-at ("was") prices aren't discounts. Both conditions use the price the customer is paying.
Does Shopify count the free shipping threshold before or after discount codes?
After. Shopify's free shipping discount and its order-value shipping rates both use the discounted cart. In the app, Cart subtotal uses the value before discounts.
Why does a customer lose free shipping when they enter a code?
Either the code doesn't combine with shipping discounts, or it takes the cart below your threshold. Check both.
Can I stop customers using free shipping and a 10% code together?
Yes. Untick Product discounts and Order discounts under Combinations in your shipping discount.
Do codes from Klaviyo or other apps need changing?
They need Shipping discounts ticked under Combinations, either in Shopify admin or in that app's own settings.