Nanobag · Cart Engineering

Removing the “EG Auto Add to Cart” App

Replacing the paid third-party app with a lightweight, theme-native free-gift feature — so add-to-cart is faster and the gift logic is fully ours to control. No visible change for shoppers.

TIMELINE~2–3 weeks calendar (incl. soak)
BUILD EFFORT~10–12 person-days
NEW CODE2 files + 1 bug fix
SHOPPER IMPACT0 same gifts, faster cart
RISKLow flag-gated, instant rollback

Why we’re doing this

🐢

The app is slow

EG runs its own extra network calls after every “Add to cart,” which is a big part of why the cart feels sluggish. Its logic lives on a third-party server we don’t control.

Native is faster

The gift logic moves into our own theme code — one lean script that reacts to the cart. Fewer round-trips, no third-party dependency, snappier checkout.

🛡️

Nothing changes for shoppers

Same free gifts, same banners, same cart look. We keep the exact gift products and rules — we just stop paying an app to add them and do it ourselves.

The plan, in 5 stages

Dev Ops / Store admin QA Go-live ← who owns each stage
STAGE 0Prep & data
2–3 days · parallel

Goal: get the store data ready so the code has real gifts and rules to work with. Runs alongside the build — not a blocker to starting.

  • Connect the Nanobag store so we can pull the 12 gift variant IDs
  • Tag qualifying bags with one qualifying tag per market
  • Gift-product hygiene — restock / recreate the broken UK, SG, INT gifts
  • Set up low-stock alerts on gift products (via qa-bot)
  • Confirm the 6 gift markets & their gift products
  • Keep banner text + PDP graphic matching the ladder
Ops / Store admin
STAGE 1Build the feature
~4 dev-days

Goal: write the two new theme files (works with placeholder IDs first, real IDs swapped in after Stage 0). No edits to the cart, mini-cart, or theme core.

  • Rules file — per-market gift ladder + on/off switch
  • Reconcile module — watches the cart, adds/removes gifts to match
  • Out-of-stock gift → skip gracefully, never blocks the cart
  • Loop-guard + “dirty” queue so it never double-fires
  • Fix mini-cart gift dedup bug (existing audit finding)
  • Self-test against the placeholder ladder
Dev
Needs from Stage 0: real gift variant IDs + qualifying tags to go from placeholder to production.
STAGE 2QA across every market
4–5 days

Goal: prove the native feature gives the exact same gifts as the app, in all 7 markets, with the mini-cart features intact. This is the long pole.

  • Per-market parity vs the app — all 7 markets
  • Mini-cart checks — tree count, progress bar, banners
  • Big-cart test (21 bags → tops out at 7+7 gifts)
  • Out-of-stock gift behaves gracefully
  • Checkout guard still blocks abuse
  • Bug-fix buffer
QADev
Runs on a test theme — nothing live. The app stays on until we’re confident.
STAGE 3Cutover
~1 day

Goal: flip the switch in one clean move — turn our feature on and the app off at the same moment, on an unpublished theme, then publish.

  • Turn our gift switch ON, disable the EG app embed
  • Publish the theme
  • Smoke-test live cart in 2–3 markets
  • Rollback = flip one switch if anything looks off
Go-liveDev
STAGE 4Soak & retire the app
~1 week watch

Goal: watch live carts for a week, keep gift stock healthy, then uninstall EG for good and stop the subscription.

  • Monitor live orders & gift accuracy for ~1 week
  • Low-stock alerts running
  • Uninstall the EG app & cancel the plan
  • Translate banners for non-EN markets (optional polish)
Ops / Store adminDev

How the weeks stack up

Stage 0 Prep & data
Ops prep
Stage 1 Build
Build
Stage 2 QA
QA · 7 markets
Stage 3 Cutover
Go
Stage 4 Soak & retire
Watch → uninstall
Week 1Week 2Week 3

Build (Stage 1) and Ops prep (Stage 0) run in parallel in Week 1, so the calendar isn’t just the sum of the stages. QA is the widest bar — 7 markets take real time to verify.

What actually gets touched (for the devs)

File / areaChangeWhat it does
assets/nb-free-gift.jsNEWWatches the cart, computes the right gifts from the ladder, adds/removes them to match. Adds each gift on its own so an out-of-stock gift is skipped, never blocking the cart.
snippets/nb-gift-rules.liquidNEWEmits the per-market gift ladder + qualifying product list + the master on/off switch.
Mini-cart gift dedupFIXExisting bug (audit H4/H5) where different gift lines can merge/corrupt — worth fixing while we’re in the gift system.
cart-drawer.liquid, main-cart.liquid, theme.jsNO CHANGEGifts stay as $0 tagged variants, so the cart & mini-cart render them exactly as today — zero edits to core.
Cart banners & PDP gift chartNO CHANGEAlready theme-side (“Image with text overlay” + Rich Text + settings text). They survive the migration untouched.

The gift ladder we’re matching (same for every market)

1+ bag
+1 carabiner
= 1 gift
4+ bags
+1 bag
= 1 bag + 1 carab
6+ bags
+2 bag +2 carab
= 3 + 3
8+ bags
+2 bag +2 carab
= 5 + 5
10+ bags
+2 bag +2 carab
= 7 + 7

Gifts stack (cumulative) as the cart grows, and plateau at 7 free bags + 7 carabiners — confirmed against a live 21-bag cart. Smaller markets just have shorter ladders.

Why this is safe

🔀 Behind an on/off switch

The whole feature is flag-gated. If anything looks wrong, one toggle turns it off and the app can be turned back on.

🧪 Tested off-stage first

All QA happens on an unpublished test theme with the app still live. We only publish once 7-market parity is proven.

🎁 Same gift products

We keep the exact $0 gift variants and tags. The cart doesn’t know the difference — it renders gifts the same way.

🚫 Can’t break “Add to cart”

Gifts are added in their own request. An out-of-stock or missing gift is skipped silently — the shopper’s actual item always goes in.

Go-live checklist (Definition of Done)

7-market paritynative feature gives identical gifts to EG in every market
Real gift IDs + tags in placestore connected, 12 variant IDs pulled, qualifying tags applied
Gift stock healthyUK/SG/INT products restocked, low-stock alerts live
Mini-cart features verifiedtree count, progress bar, banners, checkout guard all intact
Edge cases passbig-cart plateau, out-of-stock skip, tier-down removal
Clean cutover donefeature ON + EG embed OFF on unpublished theme, then published
Soak clean~1 week of live orders with correct gifts → uninstall EG & cancel plan