Hello Eldar,
suppose,
$product_id = <id of the product>
$vendor_term = <term id of the dc_vendor_shop taxonomy>
then following is the php script to change vendor of a product,
$term = get_term( $vendor_term , ‘dc_vendor_shop’ );
wp_delete_object_term_relationships( $product_id, ‘dc_vendor_shop’ );
wp_set_post_terms( $product_id, $term->name , ‘dc_vendor_shop’, true );
$vendor = get_wcmp_vendor_by_term($vendor_term);
if ( ! wp_is_post_revision( $product_id ) ) {
// update the post, which calls save_post again
wp_update_post( array(‘ID’ => $post_id, ‘post_author’ => $vendor->id) );
}
Let me know if that helps.
Regards,
Sandeep