Is it possible to recalculate cart prices? [closed]

Maybe you need to add :

wc_delete_product_transients($post->ID);

I did something like this in opther project and thats worked:

 if (is_user_logged_in()) {
add_filter('woocommerce_product_variation_get_regular_price', 'my_custom_price', 10, 2);
add_filter('woocommerce_product_variation_get_price','my_custom_price', 10, 2); } function my_custom_price( $price ) {
global $post;

// Delete product cached price  (if needed)
wc_delete_product_transients($post->ID);

// Return the new price

return $price = ($price * 1.1) ;}