add_action( 'init', function(){
    $tm_keys = array(
      'tm_epo_product_original_price',
      'tm_epo_options_prices',
      'tm_epo_product_price_with_options',
      'tmhasepo',
      'tmcartepo',
      'tmcartfee',
      'tmdata',
      'tm_epo_options_static_prices',
//       'tm_cart_item_key',
    );

  add_filter( 'wdp_cart_item_data_before_apply', function ( $cart_item_data, $original_cart_item_data ) use ( $tm_keys ) {
    foreach ( $tm_keys as $key ) {
      if ( isset( $original_cart_item_data[ $key ] ) ) {
        $cart_item_data[ $key ] = $original_cart_item_data[ $key ];
      }
    }
    
    return $cart_item_data;
  }, 10, 2 );

  add_filter( 'wdp_original_cart_item_data', function ( $original_cart_item_data ) use ( $tm_keys ) {
    foreach ( $tm_keys as $key ) {
      if ( isset( $original_cart_item_data[ $key ] ) ) {
        unset($original_cart_item_data[ $key ]);
      }
    }

    return $original_cart_item_data;
  }, 10, 1 );

  add_filter( "wdp_get_product_price", function ( $price, $product, $price_mode, $item_meta ) {
    if ( isset( $item_meta['tm_epo_product_price_with_options'] ) ) {
      return (float) $item_meta['tm_epo_product_price_with_options'];
    }

    return $price;
  }, 10, 4 );

  add_filter( 'wdp_save_cart_item_keys', function ( $keys ) use ( $tm_keys ) {
    return array_merge( $keys, $tm_keys );
  }, 10, 1 );
});