On this page
Why this happens
Bundled section rendering saves a round trip, but Shopify can update cart contents even when rendering fails. A generic catch handler that repeats the original POST can increase the quantity twice. This is different from a header badge simply having the wrong selector.
How to fix it
On a duplicate theme, inspect the add request and its sections and sections_url parameters. Check the returned section keys against the actual section IDs. Use a valid relative rendering context beginning with a slash. Check each fragment before replacing markup. If any required fragment is missing, fetch the current cart and request fresh HTML using the Section Rendering API. If rendering still fails, provide a localized cart-page link rather than silently resubmitting. Serialize cart writes and release the loading state even on failure.
Practical example
For example, a shopper adds one unit and the drawer fragment is null. Read cart.js and confirm the quantity before doing anything else. A second add is not a refresh. A network timeout is also ambiguous: reconcile cart state before offering another attempt. Keep the existing header count troubleshooting guide as a separate diagnostic for selector and event problems.
- Record initial quantity
- add once with an invalid section ID on a test theme
- verify the cart quantity increased only once
- confirm the fallback renders or links to the cart
- test a valid section and an unavailable variant
- simulate a dropped response and rapid double clicks
- repeat with a subscription line and localized storefront.

