From bf0c6dc85e5758559958f371df33ecefcda4779a Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 22 May 2026 01:32:30 -0500 Subject: [PATCH] Hide payment methods when order total is $0 When discount brings total to zero, hide the payment method selector and change button from "Continue to Secure Payment" to "Place Free Order". Co-Authored-By: Claude Opus 4.6 (1M context) --- site/public/order/fcc-compliance/index.html | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/site/public/order/fcc-compliance/index.html b/site/public/order/fcc-compliance/index.html index 6c53058..8fa587a 100644 --- a/site/public/order/fcc-compliance/index.html +++ b/site/public/order/fcc-compliance/index.html @@ -344,10 +344,22 @@ function renderServices() { if(hasPromo&&promoDisc>0) rows+='
Discount — code '+promoFromUrl.toUpperCase()+(window._promoInfo?(" ("+window._promoInfo.description+")"):"")+'-'+usd(promoDisc)+'
'; else if(hasDisc) rows+='
Bundle discount (15%)-'+usd(disc)+'
'; var totalDisc=hasPromo?promoDisc:disc; - rows+='
Total'+usd(subtotal-totalDisc)+'
'; + var finalTotal=subtotal-totalDisc; + rows+='
Total'+usd(finalTotal)+'
'; summary.innerHTML=rows; listEl.appendChild(summary); + // Hide payment methods and change button text when total is $0 + var paySection=document.getElementById("pw-payment-section"); + var submitBtn=document.getElementById("pw-submit"); + if(finalTotal<=0){ + if(paySection)paySection.style.display="none"; + if(submitBtn)submitBtn.textContent="Place Free Order \u2192"; + }else{ + if(paySection)paySection.style.display=""; + if(submitBtn)submitBtn.textContent="Continue to Secure Payment \u2192"; + } + // FCC penalty warning var penaltyBox=document.createElement("div"); penaltyBox.className="mt-3 p-4 bg-red-50 border border-red-200 rounded-lg"; @@ -386,13 +398,14 @@ function renderServices() { '
' + '
' + '' + + '
' + '

Payment Method

' + '
' + '' + '' + '' + '' + - '
' + + '
' + '' + '' + '
' +