feat: let customers remove items and empty the cart, with undo
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 2m2s
Build and deploy / Secret scan and release gate (push) Successful in 4s
Build and deploy / Publish images (push) Successful in 1m33s

Each cart item has a visible "Remover" button instead of a faint ×, and
carts with two or more items get "Esvaziar carrinho". Both show a
"Desfazer" notice for 8 seconds, so a wrong click costs nothing. The
browser test covers remove and undo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-09-24 18:18:10 -03:00
parent cbbbdb351a
commit b6a90411f1
4 changed files with 45 additions and 4 deletions

View File

@@ -748,7 +748,7 @@ footer a:hover{color:var(--laranja2)}
justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:11px;color:#5A6570}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto}}
</style>
<link rel="stylesheet" href="/site-v2.css?v=5">
<link rel="stylesheet" href="/site-v2.css?v=6">
<script src="/site-pages.js"></script>
</head>
<body>
@@ -1121,7 +1121,8 @@ footer a:hover{color:var(--laranja2)}
<h3>Seu pedido</h3>
<div class="cxE">
<h4>Itens</h4>
<div class="itensCab"><h4>Itens</h4>
<button type="button" class="esvaziar" id="bEsvaziar">Esvaziar carrinho</button></div>
<div id="itens"></div>
<div id="atual">
<div class="rot" style="margin-top:12px">Item que você está montando</div>
@@ -1216,6 +1217,9 @@ footer a:hover{color:var(--laranja2)}
<p id="checkoutStatus" class="avisoE" role="status" aria-live="polite"></p>
<div id="checkoutActions"></div>
</div>
<div class="desfazer" id="desfazer" role="status" hidden>
<span id="desfazerTxt"></span><button type="button" id="desfazerBtn">Desfazer</button>
</div>
<div class="carrVazio" id="carrVazio" hidden>
<h2>Seu carrinho está vazio</h2>
<p>Escolha um produto, envie a arte e veja o preço na hora.</p>