Hi there,
when the plugin create a new suborder, it set the vendor as post author, like in this sample code.
$vendor = yith_get_vendor( $vendor_id, 'vendor' );
$parent_order_id = $parent_order instanceof WC_Order ? $parent_order->get_id() : 0;
$order_data = apply_filters( 'woocommerce_new_order_data', array(
'post_type' => 'shop_order',
'post_title' => sprintf( __( 'Order – %s', 'yith-woocommerce-product-vendors' ), strftime( _x( '%b %d, %Y @ %I:%M %p', 'Order date parsed by strftime', 'yith-woocommerce-product-vendors' ) ) ),
'post_status' => 'wc-' . apply_filters( 'woocommerce_default_order_status', 'pending' ),
'ping_status' => 'closed',
'post_excerpt' => isset( $posted['order_comments'] ) ? $posted['order_comments'] : '',
'post_author' => $vendor->get_owner(),
'post_parent' => $parent_order_id,
'post_password' => uniqid( 'order_' ) // Protects the post just in case
)
);
$suborder_id = wp_insert_post( $order_data );
So, you just need get the post from the order_id and then the post author to obtain the vendor owner.
Once you have the $user object, you can get the vendor in this way.
$vendor = yith_get_vendor( $user_id, 'user' );
I hope be helpful for you.