FAQ WooHelpDesk Latest Questions

Mark Miller
  • 0
  • 0
How do I add Ajax to the cart link in WooCommerce?
  • 0
  • 0

To make the cart link update via Ajax, ensure WooCommerce cart fragments are enabled. Most themes load wc-cart-fragments automatically. If your cart count or mini cart does not update, check that caching/minification plugins are not delaying or removing cart fragment scripts. Exclude wc-ajax=get_refreshed_fragments and the cart/checkout pages from cache. If you want a dynamic cart count in the header, add a cart icon with a span for count and update it using WooCommerce fragments or a small custom script that listens to added_to_cart events. Many header builder plugins also provide an Ajax cart