• Resolved davih

    (@davih)


    Hi

    How to get the vendor ID on the order-details.php page?

    ./site/wp-content/plugins/woocommerce/templates/order/order-details.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sumit Singh

    (@sumitsingh89612)

    Hi @davih, You have to fetch vendor id from each product of order in order detals page.
    Using the following code you can fetch vendor id :

    $vendor = get_wcmp_product_vendors($product->get_id());
    if($vendor) {
      $vendor_id = $vendor->id;
    }

    Hello, i am using adminColumns plugin in order to manage orders and backend interface as site owner.
    I need to display Vendor name in column in Order list (mainly to be able to export orders and suborders and Sync with CRM with Vendor NAme)

    I found the Vendor_ID that contains the ID, but i cannot find any other custom field that vould contain vendor NAme field. IS tehre such a field ?

    Rajsekhar Chatterjee

    (@rajsekharchatterjee11)

    Hi @matthieuh
    If the vendor is an object then you can display vendor name with $vendor->page_title.If a vendor is an id then you can find a various way like

    get_user_meta( $vendor_id ,'nickname' ,true );
    

    get_user_meta( $vendor_id ,’first_name’ ,true );

    get_user_meta( $vendor_id ,'_vendor_page_title' ,true );
    

    etc.Let us know for any further help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get ID vendor’ is closed to new replies.