Trying to build simple deposit code that hooks into woocommerce

Try this updated code. It should work: You can check this url for more information https://awhitepixel.com/blog/woocommerce-product-data-custom-fields-tabs/

add_action( 'woocommerce_product_options_general_product_data', 'add_custom_fields_seo');

function custom_fields_save_seo( $post_id ){
$product = wc_get_product($post_id);
$num_package = isset($_POST['_deposit_price']) ? $_POST['_deposit_price'] : '';
$product->update_meta_data('_deposit_price', sanitize_text_field($num_package));
$product->save();

}
add_action( 'woocommerce_process_product_meta', 'custom_fields_save_seo' );