wordpresswoocommercepluginsdokan

woocommerce find author or vendor by product


I went to check if product belong to current vender to show edit and remove button Is there function as an example : product->get_vendor() enter image description here thx ;)


Solution

  • You can get vendor like this:

    $vendor_id = get_post_field( 'post_author', get_the_id() ); //or $product->get_id()
    $vendor = new WP_User($vendor_id);