Quote from Alex Dev on February 9, 2026, 13:03
Hello
The problem is a timing issue - when FunnelKit removes an item, the AJAX call `get_refreshed_fragments` is triggered, but the WoodMart header cart icon doesn't update because the fragments refresh happens too quickly.
Please try adding one of these code snippets to your theme's functions.php (or use a custom code snippet plugin):
Option 1 - Simple delay and refresh:
add_action('wp_footer', function() {
?>
<script>
jQuery(document).on('removed_from_cart', function() {
setTimeout(function() {
jQuery(document.body).trigger('wc_fragment_refresh');
}, 300);
});
</script>
<?php
});Option 2 - Force fragments reload:
add_action('wp_footer', function() {
?>
<script>
jQuery(document).on('removed_from_cart', function() {
setTimeout(function() {
jQuery.ajax({
url: wc_cart_fragments_params.wc_ajax_url.toString().replace('%%endpoint%%', 'get_refreshed_fragments'),
type: 'POST',
success: function(data) {
if (data && data.fragments) {
jQuery.each(data.fragments, function(key, value) {
jQuery(key).replaceWith(value);
});
}
}
});
}, 300);
});
</script>
<?php
});
Try Option 1 first - it's simpler. If that doesn't work, try Option 2.
Let me know if this resolves the issue.
p.s. renew the support please, purchase code is expired
Hello
The problem is a timing issue - when FunnelKit removes an item, the AJAX call `get_refreshed_fragments` is triggered, but the WoodMart header cart icon doesn't update because the fragments refresh happens too quickly.
Please try adding one of these code snippets to your theme's functions.php (or use a custom code snippet plugin):
Option 1 - Simple delay and refresh:
add_action('wp_footer', function() {
?>
<script>
jQuery(document).on('removed_from_cart', function() {
setTimeout(function() {
jQuery(document.body).trigger('wc_fragment_refresh');
}, 300);
});
</script>
<?php
});Option 2 - Force fragments reload:
add_action('wp_footer', function() {
?>
<script>
jQuery(document).on('removed_from_cart', function() {
setTimeout(function() {
jQuery.ajax({
url: wc_cart_fragments_params.wc_ajax_url.toString().replace('%%endpoint%%', 'get_refreshed_fragments'),
type: 'POST',
success: function(data) {
if (data && data.fragments) {
jQuery.each(data.fragments, function(key, value) {
jQuery(key).replaceWith(value);
});
}
}
});
}, 300);
});
</script>
<?php
});
Try Option 1 first - it's simpler. If that doesn't work, try Option 2.
Let me know if this resolves the issue.
p.s. renew the support please, purchase code is expired