Update mini cart in header

Hi,

I have a cart icon plus amount of items in cart in the header.
image

This doesn’t update if i enable ajax on shop page:
image

Then i also noticed that the items don’t update when you are in the cart page and changing quantities or click remove item.
image

It seems the items in the mini cart only update on page refresh. How can we make it so that the items in the mini cart are updated when adding to cart (ajax), change quantity in cart and remove item in cart?

PS: Using the Pinegrow WordPress plugin.

Thanks
Guido

@Guido not a direct PG solution, but this might be useful:

The selectors that should be updated need to be registered with the
woocommerce_add_to_cart_fragments hook.

1 Like

Hi @matjaz

Yes i tried a couple of codes that i found online but none of them actually worked properly. But didn’t tried the one you shared.

For now i just decided to go full block theme and use the mini cart block from WooCommerce in the header. Does exactly what i want out of the box! So that’s great. :wink:

Thanks
Guido