Skip to content
Free Shipping on Order over $45!
🐰 CRUELTY FREE
We don't test on animals.
📦 FREE SHIPPING
Free shipping on orders over $45.
Subscribe to our newsletter
Promotions, new products and sales. Directly to your inbox.
document.querySelectorAll('.remove-item').forEach((button) => {
button.addEventListener('click', function (event) {
event.preventDefault(); // Prevent default link behavior
const lineItemId = this.getAttribute('data-line-item-id'); // Get the line item ID
if (!lineItemId) {
console.error('No line item ID found!');
return;
}
fetch('/cart/change.js', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: lineItemId,
quantity: 0, // Set quantity to 0 to remove the item
}),
})
.then((response) => response.json())
.then((cart) => {
console.log('Item removed:', cart);
location.reload(); // Reload the page to reflect the changes
})
.catch((error) => {
console.error('Error removing item:', error);
});
});
});