On this page
What this issue is
A shopper adds a coupon, then changes the shipping method (for example from standard to express, or from delivery to pickup). The checkout recalculates, and the discount line disappears or shrinks. Sometimes an error shows. Often nothing is said and the total just rises.
It is different from a coupon being rejected in the first place. Here the code was accepted and later lost.
Why it costs you leads or sales
Shoppers who used a code expect to pay the price they saw. A higher total at the last step feels like a trick. Some leave, some contact support, and some come back later without the code. Paid traffic that arrived on a promotion is hit hardest, because the offer was the reason to click.
- Add to cartProduct added
- Apply codeDiscount accepted
- Change shippingDiscount line removed
- Review totalHigher than expected
- PayShopper abandons
The checkout works until the shipping method changes and the discount is dropped.
Example: illustrative numbers only. Completion falls when the discount is lost after a shipping change.
How to check if your site has it
Test it by hand in a private window. Do it for every shipping method and region you offer, not only the default.
Add a product and apply the code
Note the subtotal, the discount line and the total.
Go to shipping
Enter a delivery address so all methods appear.
Switch method
Select each option in turn, including pickup and free shipping.
Compare
Check that the discount line is unchanged (or changes only as the rules say) and that total = subtotal - discount + shipping + tax.
Switch back
Return to the first method. The discount should come back to the same value.
How to fix it
Common causes: the coupon is restricted to certain shipping methods or zones; a minimum-spend rule counts shipping; a theme or plugin script refreshes the order and drops the code; or caching serves a stale cart. Work through the platform below.
Check the coupon rules
In WooCommerce go to Marketing > Coupons, open the code and review Usage restriction (minimum spend, products, categories). Make sure nothing depends on shipping.
Test with plugins off
On a staging copy, switch to a default theme and disable checkout, shipping and discount plugins one by one until the discount stays.
Exclude checkout from caching
Make sure cart, checkout and the wc-ajax requests are not cached by your cache plugin or CDN.
Review the discount
In Admin go to Discounts, open the code and check Minimum purchase requirements and Combinations. Free-shipping discounts have their own countries and rate limit.
Check shipping rates
In Settings > Shipping and delivery, confirm rates and any carrier apps are not conflicting with the discount.
Check apps and scripts
Disable upsell, shipping-calculator or discount apps one at a time and retest. Customised checkout code on Shopify Plus should be reviewed.
Look for tags that touch the cart
In Preview mode, check whether any Custom HTML tag reloads the page, rewrites the URL or clears storage when the shipping step changes.
Pause suspect tags
Pause them in a workspace, preview, and retest the shipping change.
Check Ecommerce settings
In Ecommerce > Discounts, open the code and review its limits. Then check Shipping settings for conflicts.
Review custom code
Look at page and site custom code for scripts that reload the checkout.
Check the coupon
In Payments > Coupons review the products and conditions it applies to.
Test order forms
Test the order form with each shipping option and remove any custom JavaScript that resets the form.
Check the coupon
In Marketing > Coupons, review its conditions and the minimum order.
Check delivery methods
In Settings > Shipping & fulfillment, review rules per region and test each option.
Review the discount
In Commerce > Discounts check the minimum subtotal and what it applies to.
Check shipping options
Under Commerce > Shipping review rates and conditions, then retest each option.
Recalculate in one place
Compute totals on the server from the cart, the coupon and the chosen shipping method every time. Do not trust a client-side total.
Keep the coupon in session
Store the applied code with the cart and re-validate it after each shipping change instead of clearing it.
async function onShippingChange(methodId) {
const res = await fetch('/api/cart/shipping', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ shippingMethod: methodId })
});
const cart = await res.json();
// The server keeps the coupon and returns the new totals
renderTotals(cart.subtotal, cart.discount, cart.shipping, cart.total);
}Broken
- Discount line disappears
- Total rises with no message
- Shopper must re-enter the code
Fixed
- Discount stays or changes with a clear message
- Total matches the visible lines
- Switching back restores the same value
How to confirm it's fixed
- Discount line is the same for every shipping method it should apply to
- A clear message appears when a method makes the code ineligible
- Total equals subtotal minus discount plus shipping plus tax
- Switching methods back and forth gives repeatable results
- Works on mobile and in a private window
- Works for each region and each coupon type you run
How to prevent it happening again
Add the shipping-change test to your release checklist and run it after every theme, plugin, app or shipping-rate update. Test before each promotion starts, and keep a list of codes with their rules.
Day 1
A shipping plugin update is installed
Day 2
Shoppers who change shipping lose their discount
Day 5
Support gets complaints; sales dip
Day 6
The test is run and the plugin setting corrected
How FunnelGuard handles this
FunnelGuard detects this only partly. After the robot changes the shipping method, it runs an order_total_consistent check, which confirms the order total still adds up. A total that no longer adds up will be flagged, with a screenshot and a likely cause, after a re-check from a second region.
What it does not do: it does not compare the discount line before and after the change. If the discount is dropped and the total still adds up correctly with the higher price, the check can pass.
Coupon dropped
Leads or data lost
The discount line disappears and the total rises at the last step, so shoppers abandon.
Toggle the cause to compare the outcomes.
Questions people ask
Why is my discount code removed when I change shipping?
Usually the coupon has a rule tied to shipping, such as free shipping only or a minimum spend that includes shipping. It can also be a plugin or script that rebuilds the order without reapplying the code. Check the coupon's rules first, then test with plugins disabled.
Why does my checkout total change after choosing a shipping method?
Shipping cost and tax are added when the method is chosen, so the total should rise by those amounts. If it rises by more, the discount has probably been lost or recalculated. Compare the lines before and after.
How do I test whether a coupon survives a shipping change?
Apply the code, move to shipping, and select every method in turn, then switch back to the first. The discount line should stay the same unless the coupon's rules say otherwise. Do this in a private window on desktop and mobile.
Should a free shipping coupon disappear if I pick express shipping?
It can, if the code is set to apply only to certain methods or rates. In that case, show a clear message so the shopper knows why. A silent change is the part that hurts conversions.
Can caching remove a discount at checkout?
Yes. If cart or checkout requests are cached, shoppers can see stale totals or lose their code. Exclude cart, checkout and their AJAX requests from page and CDN caching.
Can FunnelGuard detect a discount removed when shipping changes?
Only partly. It checks that the order total is consistent after the shipping change, but it does not compare the discount line. You should still test each shipping method by hand.