My Account
Liquid error (templates/page.orders line 12): Array 'customer.orders' is not paginateable.
Select a purchase option to pre order this product
Countdown header
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);
});
});
});