I found a snippet to prevent the slow add-to-cart. This is a big bug.
/*
Remove recalculation of shipping cost when Add-to-Cart. This prevents slow add-to-cart.
*/
function filter_need_shipping ($val) {
$prevent_after_add = WC()->cart->prevent_recalc_on_add_to_cart;
return $val && !$prevent_after_add;
}
add_filter( 'woocommerce_cart_needs_shipping', 'filter_need_shipping' );
function mark_cart_not_to_recalc ($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) {
WC()->cart->prevent_recalc_on_add_to_cart = true;
}
add_action('woocommerce_add_to_cart', 'mark_cart_not_to_recalc', 10, 6);
Can you advise a snippet to disable running update_total for every single item?