Hey, does anyone know how to get the cart to automatically update on quantity change? I’ve tried several scripts, but it don’t seem to work with Bricks’ cart.
2 Likes
Just checking if anyone has found some solution to this
works with page reloading
const wooForm = document.querySelector('.woocommerce');
const updateCart = wooForm.querySelector("[name='update_cart']");
const clickEvent = new MouseEvent('click');
wooForm.addEventListener('click', (e)=>{
if (e.target.classList.contains('action')) {
updateCart.dispatchEvent(clickEvent);
}
});
1 Like