Fix: promo re-render trigger used wrong checkbox selector
Was looking for .svc-cb:checked but checkboxes use input[data-slug]:checked. Discount display never updated after promo info loaded. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
de50971fb3
commit
a8cdfc65f6
1 changed files with 1 additions and 1 deletions
|
|
@ -195,7 +195,7 @@ var entityBar=document.getElementById("pw-entity-bar");
|
|||
var bundleTip=document.getElementById("pw-bundle-tip");
|
||||
|
||||
// Fetch promo code info from API if present
|
||||
if(promoFromUrl){var discUrl=API+"/api/v1/discount/"+encodeURIComponent(promoFromUrl)+(emailFromUrl?"?email="+encodeURIComponent(emailFromUrl):"");fetch(discUrl).then(function(r){return r.json()}).then(function(d){if(d.valid){window._promoInfo=d;var cb=document.querySelector(".svc-cb:checked");if(cb)cb.dispatchEvent(new Event("change",{bubbles:true}));}else{window._promoInfo=null;promoFromUrl="";var pe=document.getElementById("pw-promo");if(pe){pe.value="";pe.readOnly=false;pe.style.background="";pe.style.borderColor="";}}}).catch(function(){});}
|
||||
if(promoFromUrl){var discUrl=API+"/api/v1/discount/"+encodeURIComponent(promoFromUrl)+(emailFromUrl?"?email="+encodeURIComponent(emailFromUrl):"");fetch(discUrl).then(function(r){return r.json()}).then(function(d){if(d.valid){window._promoInfo=d;var cb=document.querySelector("input[data-slug]:checked");if(cb)cb.dispatchEvent(new Event("change",{bubbles:true}));}else{window._promoInfo=null;promoFromUrl="";var pe=document.getElementById("pw-promo");if(pe){pe.value="";pe.readOnly=false;pe.style.background="";pe.style.borderColor="";}}}).catch(function(){});}
|
||||
|
||||
if(frn){
|
||||
fetch(API+"/api/v1/fcc/lookup?frn="+frn+"&quick=1").then(function(r){return r.json()}).then(function(d){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue