diff --git a/site/public/order/fcc-carrier-registration/index.html b/site/public/order/fcc-carrier-registration/index.html index 8d90d63..d65b3b1 100644 --- a/site/public/order/fcc-carrier-registration/index.html +++ b/site/public/order/fcc-carrier-registration/index.html @@ -396,13 +396,29 @@ select:focus,input:focus{outline:none;border-color:#1e3a5f;box-shadow:0 0 0 2px } // ── Q1: Service types ── + function updateVoiceQuestions() { + var hasVoice = wizard.serviceTypes.indexOf('voice') >= 0; + var isWholesaleOnly = wizard.customerType === 'wholesale'; + // Wholesale voice carriers run their own switching by definition — skip Q2, show Q3 directly + if (hasVoice && isWholesaleOnly) { + document.getElementById('q2').classList.add('hidden'); + document.getElementById('q3').classList.remove('hidden'); + wizard.voiceDelivery = 'own_switch'; // implied for wholesale + } else if (hasVoice) { + document.getElementById('q2').classList.remove('hidden'); + // Q3 visibility still controlled by Q2 answer + } else { + document.getElementById('q2').classList.add('hidden'); + document.getElementById('q3').classList.add('hidden'); + } + } document.querySelectorAll('[data-svc]').forEach(function(cb) { cb.addEventListener('change', function() { wizard.serviceTypes = Array.from(document.querySelectorAll('[data-svc]:checked')).map(function(c) { return c.dataset.svc; }); var hasVoice = wizard.serviceTypes.indexOf('voice') >= 0; var hasBroadband = wizard.serviceTypes.indexOf('broadband') >= 0; document.getElementById('q1b').classList.toggle('hidden', !hasVoice && !hasBroadband); - document.getElementById('q2').classList.toggle('hidden', !hasVoice); + updateVoiceQuestions(); document.getElementById('q4').classList.toggle('hidden', !hasBroadband); if (hasVoice || hasBroadband) document.getElementById('q5').classList.remove('hidden'); }); @@ -413,6 +429,8 @@ select:focus,input:focus{outline:none;border-color:#1e3a5f;box-shadow:0 0 0 2px document.querySelectorAll('[data-custtype]').forEach(function(b) { b.classList.remove('selected'); }); btn.classList.add('selected'); wizard.customerType = btn.dataset.custtype; + // Re-evaluate whether to show Q2 or skip to Q3 + updateVoiceQuestions(); }); });