Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Created March 13, 2026 15:00
Show Gist options
  • Select an option

  • Save xlplugins/6d5cdfd7815622657692f4fc7b7d3cac to your computer and use it in GitHub Desktop.

Select an option

Save xlplugins/6d5cdfd7815622657692f4fc7b7d3cac to your computer and use it in GitHub Desktop.
Reload issue with slide cart
add_action( 'wp_enqueue_scripts', function() {
if ( ! apply_filters( 'fkcart_prevent_cart_reload', true ) ) {
return;
}
if ( is_cart() ) {
return;
}
$inline = <<<'JS'
(function($){
$(document).on('added_to_cart.wc-cart wc_update_cart.wc-cart', function(e){
if (!$('.woocommerce-cart-form').length) {
e.stopImmediatePropagation();
}
});
})(jQuery);
JS;
wp_add_inline_script( 'jquery', $inline, 'after' );
}, 5 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment