Change product_type from simple to variable in WooCommerce


I know that WooCommerce plugin store product_type in taxomony I use that code

// TODO change taxonomy // product_type = variable $  terms = get_the_terms($  post_id, "product_type"); foreach ($  terms as $  term) {     $  termId = $  term->term_id;     // TODO figure out why is not work     wp_update_term($  termId, "variable"); } 

Why it not works?