This might not answer your question directly or fully. These are just some thoughts / ways to get the thing done, which came into my mind after reading your question.
I don’t know if WC_Product can be modified directly, but you can at least extend it and create a custom product type. E.g. WC_Vendor_Product extends WC_Product
. You would then add the custom properties and methods to your custom type class.
Another way that comes into my mind is to use a custom taxonomy for the vendors. They could then be created as terms with some custom meta data added to the terms.
Vendors could also be users or CPT. In this case you’d create a term for each user/post and use the user/post ID as the term slug (wp_set_object_terms
). This way the term would only act as a medium between the product and the vendor, and you could do tax_queries for the products with the user/post ID (used as string).
Or if users are vendors then you could use the author
field of the products to connect products with users.