AJAX Add to Cart Doesn’t Work and Mini Cart Does Not Update or Open
-
Issue description:
I am using WooCommerce with JetEngine listing grids to display products. The product buttons include the correct WooCommerce classes (add_to_cart_button ajax_add_to_cart) and clicking the button successfully triggers the WooCommerce add-to-cart logic. Previously I could see the request?wc-ajax=add_to_cartfiring in the browser network tab, but the mini cart does not update or open afterward. On some tests the request stopped appearing entirely when testing custom scripts. My header contains a mini cart component (Elementor / theme cart drawer).What I’ve tested so far:
- Confirmed the button markup includes
add_to_cart_buttonandajax_add_to_cart. - Verified the WooCommerce scripts load on the page (
add-to-cart.min.js,cart-fragments.min.js,mini-cart.js,cart.js). - Temporarily disabled WP Rocket optimizations and cleared Cloudflare cache.
- Tested console events (
added_to_cart,adding_to_cart) which do fire. - Attempted fragment refresh scripts and mini cart trigger scripts but these either had no effect or prevented the AJAX request from firing.
i have also, remeoved delay js settings, cleared cache, tried mutliple scripts to fire ajax and fragments. disbaled all plugins
Observed behavior:
On page load I see the following scripts loaded:add-to-cart.min.js,cart-fragments.min.js,mini-cart.js,cart.js.
However after clicking the button I either see no new network requests or previously saw?wc-ajax=add_to_cartwithout the mini cart refreshing. I also do not see requests such as?wc-ajax=get_refreshed_fragments.Question:
Is there a recommended way to ensure WooCommerce AJAX add-to-cart works correctly with custom listing grids (JetEngine / Elementor) so the mini cart fragments refresh and the cart drawer opens? Or is additional markup or a different WooCommerce hook required for non-archive product loops? - Confirmed the button markup includes
You must be logged in to reply to this topic.