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
vtexjs.checkout.getOrderForm().then(function (orderForm) { | |
var clientProfileData = orderForm.clientProfileData; | |
if(clientProfileData == null || clientProfileData == undefined){ | |
var ClientProfileDataCallCenterDisclaimer = function() {this.attachmentId = "clientProfileData";this.email = null;}; | |
clientProfileData = new ClientProfileDataCallCenterDisclaimer(); | |
} | |
clientProfileData.email = 'exemplo@email.com'; // APLICA O EMAIL DESEJADO | |
return vtexjs.checkout.sendAttachment('clientProfileData', clientProfileData) | |
}).done(function (orderForm) { |
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 eraseCart = () => { | |
document.cookie = `checkout.vtex.com=;Domain=.${window.location.hostname};path=/;expires=Thu, 01-Jan-1970 00:00:01 GMT`; | |
$.ajax({ | |
url: `${location.origin}/api/checkout/pub/orderForm/`, | |
type: "GET", | |
dataType: "json", | |
success: () => { | |
location.replace(`${location.origin}/checkout`); | |
}, | |
error: (error) => { |
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
var data = JSON.parse(window.localStorage.getItem('aditionalShippingData')); | |
data.selectedLeanShippingOption = "FASTEST"; // ou CHEAPEST | |
window.localStorage.setItem('aditionalShippingData',JSON.stringify(data)); |