plugins – My total checkout is not the same than my total cart

i’m trying to create an estimate form plugin on wordpress using woocommerce. I’m able to get the total price of my form on my cart but not on the checkout page. The value “prix” diseappear after cart page.
Thanks

<form class="cart" action="http://test.local/cart/" method="post" enctype="multipart/form-data">
    <input type="hidden" name="test" v-model="prix"/>
        <button type="submit" name="add-to-cart" value="28838" class="single_add_to_cart_button button alt">Ajouter au panier</button>

</form>

`
if ( ! class_exists( ‘Price_Override’ ) ) {
/**
*
*/
class Price_Override {

  function __construct() {
    add_action( 'woocommerce_before_calculate_totals', array( $this, 'update_price' ) );
  }

  function update_price( $cart_object ) {
    $cart_items = $cart_object->cart_contents;

    if ( ! empty( $cart_items ) ) {
      $price = $_POST('test');
      foreach ( $cart_items as $key => $value ) {
      $value('data')->set_price( $price );
      }
    }
  }
}

function initialise_main_class() {
  new Price_Override();
}

add_action( 'plugins_loaded', 'initialise_main_class' );

}
`