Status: ❌ Not connected
Paste this once in the dev theme, before </body>:
<script>(function(){try{const p=new URLSearchParams(location.search);const c=p.get("af_just_applied");if(!c)return;const w=document.createElement("div");w.style.cssText="position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:99999;padding:12px 16px;border-radius:10px;background:rgba(0,0,0,.85);color:#fff;font:14px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;box-shadow:0 6px 20px rgba(0,0,0,.35);max-width:90vw;text-align:center";w.textContent="Coupon "+c+" activated.";document.body.appendChild(w);setTimeout(()=>w.remove(),5000);p.delete("af_just_applied");const u=location.pathname+(p.toString()?"?"+p.toString():"")+location.hash;history.replaceState({}, "", u);}catch(e){}})();</script>
Add this near the top of theme.liquid to catch any /CODE without a server redirect:
<script>(function(){try{var p=location.pathname;if(!/^\/[A-Za-z0-9_-]+$/.test(p))return;var s=p.slice(1);var r=new Set(["cart","checkout","account","collections","products","pages","blogs","policies","search","apps","discount","a","admin","orders","gift_cards","challenge"]);if(r.has(s))return;location.replace("/discount/"+encodeURIComponent(s)+"?redirect=/&af_just_applied="+encodeURIComponent(s));}catch(e){}})();</script>