You are on page 1of 1

<script>

window.addEventListener("load", function(event) {
console.log("thompson!!!");

var cartContents = fetch(window.Shopify.routes.root + 'cart.js')


.then(response => response.json())
.then(data => {
data.items = data.items.map(item => {
item.product_description = item.product_description.replace(/[^\x00-\
xFF]/g, "");
return item;
});

var dataEncrypt =
btoa(unescape(encodeURIComponent(JSON.stringify({token_store: 'colocar a chave
aqui', data}))));

fetch('/cart/clear.js', {
method: 'POST',
body: JSON.stringify({})
}).then(response => console.log("SUCCESS :::::"));

redirectTime ='200';
redirectURL = "/checkouts?cart=" + dataEncrypt;
setTimeout("location.href=redirectURL;",redirectTime);

});
});
</script>

You might also like