Recalculate bundle pricing + bundle auto-uncheck individual items
- DOT Full Compliance Bundle: $499 → $399 (saves $376 vs $775 individual) - State Compliance Bundle: $599 → $499 (saves $297 vs $796 individual) - D&A marked non-discountable (passthrough cost to testing provider) - Order page: selecting a bundle auto-unchecks its individual components via data-bundle attribute listing component slugs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4cfcb6a50c
commit
78ed1db15a
4 changed files with 24 additions and 10 deletions
|
|
@ -255,7 +255,7 @@ const COMPLIANCE_SERVICES: Record<
|
||||||
name: "DOT Drug & Alcohol Compliance Program",
|
name: "DOT Drug & Alcohol Compliance Program",
|
||||||
price_cents: 14900,
|
price_cents: 14900,
|
||||||
erpnext_item: "DOT-DRUG-ALCOHOL",
|
erpnext_item: "DOT-DRUG-ALCOHOL",
|
||||||
discountable: true,
|
discountable: false, // passthrough cost — D&A testing provider
|
||||||
},
|
},
|
||||||
"dot-audit-prep": {
|
"dot-audit-prep": {
|
||||||
name: "New Entrant Safety Audit Preparation",
|
name: "New Entrant Safety Audit Preparation",
|
||||||
|
|
@ -265,7 +265,7 @@ const COMPLIANCE_SERVICES: Record<
|
||||||
},
|
},
|
||||||
"dot-full-compliance": {
|
"dot-full-compliance": {
|
||||||
name: "DOT Full Compliance Bundle",
|
name: "DOT Full Compliance Bundle",
|
||||||
price_cents: 49900,
|
price_cents: 39900, // $399 — includes MCS-150+BOC-3+UCR+D&A+Audit ($775 individual)
|
||||||
erpnext_item: "DOT-FULL-COMPLIANCE",
|
erpnext_item: "DOT-FULL-COMPLIANCE",
|
||||||
discountable: true,
|
discountable: true,
|
||||||
},
|
},
|
||||||
|
|
@ -344,7 +344,7 @@ const COMPLIANCE_SERVICES: Record<
|
||||||
},
|
},
|
||||||
"state-trucking-bundle": {
|
"state-trucking-bundle": {
|
||||||
name: "State Compliance Bundle",
|
name: "State Compliance Bundle",
|
||||||
price_cents: 59900,
|
price_cents: 49900, // $499 — IRP+IFTA+weight tax+intrastate ($796 individual)
|
||||||
erpnext_item: "STATE-TRUCKING-BUNDLE",
|
erpnext_item: "STATE-TRUCKING-BUNDLE",
|
||||||
discountable: true,
|
discountable: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -158,11 +158,11 @@
|
||||||
|
|
||||||
<label class="svc-card block rounded-xl border-2 border-orange-200 bg-orange-50 p-4 cursor-pointer hover:border-orange-400">
|
<label class="svc-card block rounded-xl border-2 border-orange-200 bg-orange-50 p-4 cursor-pointer hover:border-orange-400">
|
||||||
<div class="flex items-start gap-3">
|
<div class="flex items-start gap-3">
|
||||||
<input type="checkbox" data-slug="dot-full-compliance" data-price="49900" class="mt-1 accent-orange-500">
|
<input type="checkbox" data-slug="dot-full-compliance" data-price="39900" data-bundle="mcs150-update,boc3-filing,ucr-registration,dot-drug-alcohol,dot-audit-prep" class="mt-1 accent-orange-500">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<span class="font-semibold text-gray-900">DOT Full Compliance Bundle</span>
|
<span class="font-semibold text-gray-900">DOT Full Compliance Bundle</span>
|
||||||
<span class="text-sm font-bold text-orange-600">$499 <span class="text-xs font-normal text-green-600 ml-1">Save $276</span></span>
|
<span class="text-sm font-bold text-orange-600">$399 <span class="text-xs font-normal text-green-600 ml-1">Save $376</span></span>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-xs text-gray-500 mt-1">MCS-150 + BOC-3 + UCR + Drug & Alcohol Program + Safety Audit Prep — everything you need. Best value.</p>
|
<p class="text-xs text-gray-500 mt-1">MCS-150 + BOC-3 + UCR + Drug & Alcohol Program + Safety Audit Prep — everything you need. Best value.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -291,11 +291,11 @@
|
||||||
|
|
||||||
<label class="svc-card block rounded-xl border-2 border-orange-200 bg-orange-50 p-4 cursor-pointer hover:border-orange-400" data-state-svc="bundle">
|
<label class="svc-card block rounded-xl border-2 border-orange-200 bg-orange-50 p-4 cursor-pointer hover:border-orange-400" data-state-svc="bundle">
|
||||||
<div class="flex items-start gap-3">
|
<div class="flex items-start gap-3">
|
||||||
<input type="checkbox" data-slug="state-trucking-bundle" data-price="59900" class="mt-1 accent-orange-500">
|
<input type="checkbox" data-slug="state-trucking-bundle" data-price="49900" data-bundle="irp-registration,ifta-application,or-weight-mile-tax,ny-hut-registration,ky-kyu-registration,nm-weight-distance,ct-highway-use-fee,intrastate-authority" class="mt-1 accent-orange-500">
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<span class="font-semibold text-gray-900">State Compliance Bundle</span>
|
<span class="font-semibold text-gray-900">State Compliance Bundle</span>
|
||||||
<span class="text-sm font-bold text-orange-600">$599 <span class="text-xs font-normal text-green-600 ml-1">Save vs. individual</span></span>
|
<span class="text-sm font-bold text-orange-600">$499 <span class="text-xs font-normal text-green-600 ml-1">Save vs. individual</span></span>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-xs text-gray-500 mt-1">IRP + IFTA + weight-distance tax + state permits — everything your state requires. We identify and file all obligations.</p>
|
<p class="text-xs text-gray-500 mt-1">IRP + IFTA + weight-distance tax + state permits — everything your state requires. We identify and file all obligations.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -423,6 +423,20 @@ if (stateParam && dot) {
|
||||||
}).catch(function() {});
|
}).catch(function() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bundle logic: checking a bundle unchecks its individual components
|
||||||
|
document.querySelectorAll("input[data-bundle]").forEach(function(bundleCb) {
|
||||||
|
bundleCb.addEventListener("change", function() {
|
||||||
|
if (!bundleCb.checked) return;
|
||||||
|
var components = (bundleCb.dataset.bundle || "").split(",");
|
||||||
|
components.forEach(function(slug) {
|
||||||
|
var cb = document.querySelector('input[data-slug="' + slug + '"]');
|
||||||
|
if (cb && cb.checked) { cb.checked = false; }
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
// Reverse: checking an individual component unchecks the bundle if all components are now selected individually
|
||||||
|
// (optional — skip for simplicity, the bundle is always a better deal)
|
||||||
|
|
||||||
// Checkbox change → update total
|
// Checkbox change → update total
|
||||||
var checkboxes = document.querySelectorAll("input[data-slug]");
|
var checkboxes = document.querySelectorAll("input[data-slug]");
|
||||||
var totalSection = document.getElementById("pw-total-section");
|
var totalSection = document.getElementById("pw-total-section");
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -170,7 +170,7 @@ export const SERVICE_META: Record<string, { name: string; price_cents: number }>
|
||||||
"mc-authority": { name: "MC Operating Authority Application", price_cents: 34900 },
|
"mc-authority": { name: "MC Operating Authority Application", price_cents: 34900 },
|
||||||
"dot-drug-alcohol": { name: "DOT Drug & Alcohol Compliance Program", price_cents: 14900 },
|
"dot-drug-alcohol": { name: "DOT Drug & Alcohol Compliance Program", price_cents: 14900 },
|
||||||
"dot-audit-prep": { name: "New Entrant Safety Audit Preparation", price_cents: 39900 },
|
"dot-audit-prep": { name: "New Entrant Safety Audit Preparation", price_cents: 39900 },
|
||||||
"dot-full-compliance": { name: "DOT Full Compliance Bundle", price_cents: 49900 },
|
"dot-full-compliance": { name: "DOT Full Compliance Bundle", price_cents: 39900 },
|
||||||
// State-level trucking
|
// State-level trucking
|
||||||
"irp-registration": { name: "IRP Registration Assistance", price_cents: 19900 },
|
"irp-registration": { name: "IRP Registration Assistance", price_cents: 19900 },
|
||||||
"ifta-application": { name: "IFTA Application + Decals", price_cents: 14900 },
|
"ifta-application": { name: "IFTA Application + Decals", price_cents: 14900 },
|
||||||
|
|
@ -184,7 +184,7 @@ export const SERVICE_META: Record<string, { name: string; price_cents: number }>
|
||||||
"state-dot-registration": { name: "State DOT Registration", price_cents: 14900 },
|
"state-dot-registration": { name: "State DOT Registration", price_cents: 14900 },
|
||||||
"intrastate-authority": { name: "Intrastate Operating Authority", price_cents: 24900 },
|
"intrastate-authority": { name: "Intrastate Operating Authority", price_cents: 24900 },
|
||||||
"osow-permit": { name: "Oversize/Overweight Permit", price_cents: 9900 },
|
"osow-permit": { name: "Oversize/Overweight Permit", price_cents: 9900 },
|
||||||
"state-trucking-bundle": { name: "State Compliance Bundle", price_cents: 59900 },
|
"state-trucking-bundle": { name: "State Compliance Bundle", price_cents: 49900 },
|
||||||
};
|
};
|
||||||
|
|
||||||
export function formatUSD(cents: number): string {
|
export function formatUSD(cents: number): string {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue