From ad3a966ae2fde3717ed1aadd06945ca4105a2eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Wed, 18 Nov 2026 11:20:10 -0300 Subject: [PATCH] fix: a cart with a quality note to confirm guides the customer to it instead of an error (DTF-WEB-Y) Enter in the coupon field sends the cart like "Aplicar" and "Pagar"; with a quality note still unconfirmed, the guard's expected message was red and reached Sentry. It is now a warning, and the page scrolls to the first note to confirm. Co-Authored-By: Claude Opus 5.5 (1M context) --- web/checkout.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web/checkout.js b/web/checkout.js index fdb18b8..9b3ca5b 100644 --- a/web/checkout.js +++ b/web/checkout.js @@ -471,7 +471,12 @@ if (draftId) clearDraft(); if (!clienteOk() || !entrega.cotado) return; if (!enderecoOk()) return message('Preencha o endereço de entrega.','error'); - if (!cartPodeEnviar()) return message('Revise a qualidade e confirme a ressalva de cada item antes de enviar o pedido.','error'); + // Guidance, not a failure: the customer still has a quality note to + // confirm, and the page takes them to it (Sentry DTF-WEB-Y). + if (!cartPodeEnviar()) { + document.querySelector('.aceiteRes input:not(:checked)')?.closest('label')?.scrollIntoView({behavior:'smooth',block:'center'}); + return message('Revise a qualidade e confirme a ressalva de cada item antes de enviar o pedido.','warn'); + } const semArquivo=faltaEnvioMensagem(); if (semArquivo) return message(semArquivo+'.','error'); const cart = itensAPagar(); @@ -873,7 +878,8 @@ if (!naPagina() && semPedidos) message('No momento não estamos recebendo pedidos pelo site.','warn'); }); // "Aplicar" sends the coupon with the cart: there is no public route to test - // a code, so the server's answer comes with the quote (front 8.3). + // a code, so the server's answer comes with the quote (front 8.3). Enter in + // the field does the same, and so meets the same checks as "Pagar". const aplicarCupom=document.getElementById('bCupom'); if(aplicarCupom)aplicarCupom.onclick=()=>window.dtfCheckout(); const campoCupom=document.getElementById('fCupom');