I want to add 300 to order total on woocommerce checkout page but woocommerce_calculate_totals hook doesn't do the job...
If I use var_dump($total), I see the correct result - int(number), but the total amount in order table is not changing.
add_action( 'woocommerce_calculate_totals', 'action_cart_calculate_totals', 10, 1 );
function action_cart_calculate_totals( $cart_object) {
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
if ( !WC()->cart->is_empty() ):
$total = $cart_object->cart_contents_total += 300;
var_dump($total);
endif;
}