feat: give payment its own page
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 2m12s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m35s
All checks were successful
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Successful in 2m12s
Build and deploy / Secret scan and release gate (push) Successful in 6s
Build and deploy / Publish images (push) Successful in 1m35s
The PIX and card choices appeared under the cart, on the same page as the customer's details. "Ir para o pagamento" now sends the order and opens /pagamento, step 3 of the progress bar: the server's order summary, then PIX or card, each opening below. The cart keeps only the sending progress and its errors; a changed cart is sent again instead of offering the old quote. Portal links open the payment page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/* Site DTF — the Site's pages: the home, one page per product and the cart.
|
||||
/* Site DTF — the Site's pages: the home, one page per product, the cart and
|
||||
the payment page.
|
||||
They share this document, so artworks already loaded in the browser survive
|
||||
moving between them; each page has its own address, so Back, Forward, reload
|
||||
and shared links behave as in any store. nginx serves index.html for these
|
||||
@@ -6,14 +7,15 @@
|
||||
site-steps.js does the navigation. */
|
||||
const PAGINAS={file:'/arquivo-por-metro', avulsa:'/artes-avulsas',
|
||||
uvfile:'/uv-arquivo-por-metro', uv:'/uv-artes-avulsas'};
|
||||
const CARRINHO='/carrinho';
|
||||
const CARRINHO='/carrinho', PAGAMENTO='/pagamento';
|
||||
function paginaDe(caminho){
|
||||
caminho=caminho.replace(/\/+$/,'')||'/';
|
||||
if(caminho===CARRINHO) return {pagina:'carrinho'};
|
||||
if(caminho===PAGAMENTO) return {pagina:'pagamento'};
|
||||
const m=Object.keys(PAGINAS).find(k=>PAGINAS[k]===caminho);
|
||||
return m ? {pagina:'produto',modo:m} : {pagina:'inicio'};
|
||||
}
|
||||
// Older portal links open a quote on the home address; quotes live in the cart.
|
||||
if(location.pathname==='/' && new URLSearchParams(location.search).has('quote'))
|
||||
history.replaceState(null,'',CARRINHO+location.search);
|
||||
// Portal links, old and new, open a quote on the payment page.
|
||||
if(['/',CARRINHO].includes(location.pathname.replace(/\/+$/,'')||'/') && new URLSearchParams(location.search).has('quote'))
|
||||
history.replaceState(null,'',PAGAMENTO+location.search);
|
||||
document.documentElement.dataset.rota=paginaDe(location.pathname).pagina;
|
||||
|
||||
Reference in New Issue
Block a user