From 868b0eeca5469942680febaef3f99c717f4a6812 Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 21 May 2026 15:16:27 -0500 Subject: [PATCH] Pass promo code through compliance checker to order page - Compliance checker reads ?code= from URL, stores it, passes it through to the order page CTA link - Allows email campaigns to link to checker with coupon pre-applied Co-Authored-By: Claude Opus 4.6 (1M context) --- site/src/pages/tools/fcc-compliance-check.astro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/src/pages/tools/fcc-compliance-check.astro b/site/src/pages/tools/fcc-compliance-check.astro index bbe306f..9d00a85 100644 --- a/site/src/pages/tools/fcc-compliance-check.astro +++ b/site/src/pages/tools/fcc-compliance-check.astro @@ -225,6 +225,9 @@ import Base from "../../layouts/Base.astro"; // Race condition guard — cancel prior fetch when new one starts let currentController = null; + // Promo code passthrough from URL (e.g. ?code=MEMORIAL25) + let urlPromoCode = ""; + // --- Name search --- nameSearchBtn?.addEventListener("click", runNameSearch); nameInput?.addEventListener("keydown", (e) => { if (e.key === "Enter") runNameSearch(); }); @@ -1026,7 +1029,7 @@ import Base from "../../layouts/Base.astro"; // Update link const btn = document.getElementById("get-started-btn"); if (btn) { - btn.href = `/order/fcc-compliance?services=${selectedIds.join(",")}&frn=${frn}`; + btn.href = `/order/fcc-compliance?services=${selectedIds.join(",")}&frn=${frn}${urlPromoCode ? "&code=" + encodeURIComponent(urlPromoCode) : ""}`; } } @@ -1130,6 +1133,7 @@ import Base from "../../layouts/Base.astro"; const params = new URLSearchParams(window.location.search); const frn = params.get("frn"); const entity = params.get("entity"); + urlPromoCode = params.get("code") || params.get("promo") || ""; if (frn) { frnInput.value = frn;