Blog

Updating the WooCommerce mini-cart via AJAX

The mini-cart is a scaled-down version of the WooCommerce cart. It’s the template that the WooCommerce Cart widget uses to display the user’s cart in the sidebar or footer. In a client build, I decided to use the mini-cart template to display the user’s cart when they hover over the cart icon in the navigation menu. However, I found that with caching plugins also running, it’s possible to run into problems with the mini-cart not displaying the correct information to users – in effect, they’d be viewing the contents of other users’ carts. Read more