Simplify paid intake review flow
This commit is contained in:
parent
74acda7171
commit
fcb56a4707
15 changed files with 16 additions and 49 deletions
|
|
@ -197,6 +197,11 @@ const STEP_LABELS: Record<string, string> = {
|
|||
}
|
||||
.pw-btn-plain { background: #e2e8f0; color: #1f2937; }
|
||||
.pw-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
html.pw-paid-intake .pw-price-banner,
|
||||
html.pw-paid-intake .pw-taxdeduct,
|
||||
html.pw-paid-intake .pw-tvalue {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
|
@ -334,7 +339,9 @@ const STEP_LABELS: Record<string, string> = {
|
|||
// ── Pre-fill from order data when accessed via token (paid batch order) ──
|
||||
// Also remove the "payment" step since payment is already done.
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
if (urlParams.has("token") || urlParams.has("order")) {
|
||||
const paidIntakeMode = urlParams.has("token") || urlParams.has("order");
|
||||
if (paidIntakeMode) {
|
||||
document.documentElement.classList.add("pw-paid-intake");
|
||||
const payIdx = steps.indexOf("payment");
|
||||
if (payIdx >= 0) {
|
||||
steps.splice(payIdx, 1);
|
||||
|
|
@ -490,7 +497,9 @@ const STEP_LABELS: Record<string, string> = {
|
|||
});
|
||||
(document.getElementById("pw-back") as HTMLButtonElement).disabled = idx === 0;
|
||||
const nextBtn = document.getElementById("pw-next") as HTMLButtonElement;
|
||||
nextBtn.textContent = idx === steps.length - 1 ? "Finish" : "Next →";
|
||||
nextBtn.textContent = idx === steps.length - 1
|
||||
? (paidIntakeMode ? "Submit Intake" : "Finish")
|
||||
: "Next →";
|
||||
// Scroll to page title (above the wizard)
|
||||
const pageTitle = document.querySelector("main h1, .pw-order-intro h1");
|
||||
(pageTitle || wizard).scrollIntoView({ behavior: "smooth", block: "start" });
|
||||
|
|
@ -558,7 +567,7 @@ const STEP_LABELS: Record<string, string> = {
|
|||
}).catch(() => {}); // silent — don't block the user
|
||||
}
|
||||
|
||||
async function submitIntake(state: IntakeState) {
|
||||
async function submitIntake(state: IntakeState) {
|
||||
const nextBtn = document.getElementById("pw-next") as HTMLButtonElement;
|
||||
nextBtn.disabled = true;
|
||||
nextBtn.textContent = "Submitting...";
|
||||
|
|
@ -580,7 +589,7 @@ const STEP_LABELS: Record<string, string> = {
|
|||
if (!email || !name) {
|
||||
alert("Please enter your business name and email before finishing.");
|
||||
nextBtn.disabled = false;
|
||||
nextBtn.textContent = "Finish";
|
||||
nextBtn.textContent = paidIntakeMode ? "Submit Intake" : "Finish";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
|
|
@ -645,7 +654,7 @@ const STEP_LABELS: Record<string, string> = {
|
|||
} catch (e: any) {
|
||||
alert("Could not start checkout: " + (e.message || "please try again."));
|
||||
nextBtn.disabled = false;
|
||||
nextBtn.textContent = "Finish";
|
||||
nextBtn.textContent = paidIntakeMode ? "Submit Intake" : "Finish";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -686,12 +695,12 @@ const STEP_LABELS: Record<string, string> = {
|
|||
const err = await saveResp.json().catch(() => ({}));
|
||||
alert(err.error || "Failed to submit. Please try again.");
|
||||
nextBtn.disabled = false;
|
||||
nextBtn.textContent = "Finish";
|
||||
nextBtn.textContent = paidIntakeMode ? "Submit Intake" : "Finish";
|
||||
}
|
||||
} catch (e) {
|
||||
alert("Network error. Please try again.");
|
||||
nextBtn.disabled = false;
|
||||
nextBtn.textContent = "Finish";
|
||||
nextBtn.textContent = paidIntakeMode ? "Submit Intake" : "Finish";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "California Motor Carrier Permit (MCP) plus CARB Clean Truck
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Connecticut Highway Use Fee registration for heavy multi-un
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "PHMSA hazardous-materials registration for carriers transpo
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "International Fuel Tax Agreement (IFTA) license and decals
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Quarterly IFTA fuel-tax return preparation and filing throu
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Apportioned (IRP) registration for interstate carriers —
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Kentucky KYU weight-distance tax license for carriers opera
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "FMCSA biennial update of company profile, fleet size, and m
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["entity", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "New Mexico Weight-Distance Tax permit and account setup.";
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "New York Highway Use Tax (HUT) registration and decal for c
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Oregon Weight-Mile Tax enrollment and account setup for car
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "State clean-truck / emissions compliance (NY, CO, MD, NJ, M
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Unified Carrier Registration for interstate carriers.";
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["entity", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
import Base from "../../layouts/Base.astro";
|
||||
import Wizard from "../../components/intake/Wizard.astro";
|
||||
import OrderPriceBanner from "../../components/OrderPriceBanner.astro";
|
||||
import TaxDeductibilityNotice from "../../components/TaxDeductibilityNotice.astro";
|
||||
import TruckingOrderHeader from "../../components/TruckingOrderHeader.astro";
|
||||
import TruckingValueNotice from "../../components/TruckingValueNotice.astro";
|
||||
import { INTAKE_MANIFEST, SERVICE_META } from "../../lib/intake_manifest";
|
||||
|
|
@ -24,8 +23,6 @@ const description = "Reactivate an inactive or revoked USDOT number and bring yo
|
|||
<TruckingOrderHeader />
|
||||
|
||||
<OrderPriceBanner priceCents={meta?.price_cents} govFeeLabel={meta?.gov_fee_label} note="Choose card, ACH, or PayPal at payment." />
|
||||
<TaxDeductibilityNotice />
|
||||
|
||||
<TruckingValueNotice slug={slug} />
|
||||
|
||||
<Wizard service_slug={slug} steps={steps ?? ["state-trucking", "review", "payment"]} title={meta?.name ?? slug} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue