This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Información de sessions (regionId, cookies, auth, stores, etc) | |
const sessions = '/api/sessions/?items=*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch("/api/sessions/", { | |
method: 'PATCH', | |
headers: { | |
"Content-Type":"application/json" | |
}, | |
body: JSON.stringify({ | |
"public": { | |
"regionId": { | |
"value": btoa("SW#"+`${account}0127;${account}0178;chedrauimxdarkstore`) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Coincidencias Basicas | |
. - Cualquier Caracter, excepto nueva linea | |
\d - Cualquier Digitos (0-9) | |
\D - No es un Digito (0-9) | |
\w - Caracter de Palabra (a-z, A-Z, 0-9, _) | |
\W - No es un Caracter de Palabra. | |
\s - Espacios de cualquier tipo. (espacio, tab, nueva linea) | |
\S - No es un Espacio, Tab o nueva linea. | |
Limites |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resolveURLGraphql = () => { | |
let graphql = '' | |
const isProduction = vtex?.renderRuntime?.production | |
let vtexapi = `https://${vtex.renderRuntime.query.origin}` | |
if (isProduction) { | |
graphql = `${vtexapi}/_v/segment/graphql/v1` | |
} else { | |
graphql = `${vtexapi}/_v/private/graphql/v1` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const setLocalStorage = () => { | |
if(typeof localStorage !== "undefined"){ | |
try{ | |
localStorage?.setItem("", JSON.stringify(data)); | |
}catch(e){ | |
console.error(e); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vtex.events.subscribe('checkoutSteps', (currentView) => { | |
// profile, shipping, payment | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).on('orderFormUpdated.vtex', (event, orderForm) => console.log("orderFormUpdated.vtex")); | |
$(window).on('orderFormUpdated.vtex', (event, orderForm) => console.log("orderFormUpdated.vtex")); | |
$(window).on('checkoutRequestEnd.vtex', (event, orderForm) => console.log("checkoutRequestEnd.vtex")); | |
$(window).on('checkout.vtex.com', (event, orderForm) => console.log("checkout.vtex.com ")); | |
$(window).on('.vtexIdUI', (event, orderForm) => console.log(".vtexIdUI")); |