• Resolved hwsiew

    (@hwsiew)


    Hi, is it possible to get a list of customers whom had purchased product(s) from a vendor before?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Rajsekhar Chatterjee

    (@rajsekharchatterjee11)

    hi @hwsiew
    You can fetch all customer email of a specific vendor form this below code

    // get customer details of a vendor
      $vendor_id = 10 // vendor is
      $vendor = get_wcmp_vendor( $vendor_id );
      $records = $vendor->get_orders();
      $customer_billing_email = array();
      foreach ($records as $key => $value) {
        $order = new WC_Order( $order_id );
        $customer_billing_email[] = $order->billing_email;
      } 
    Thread Starter hwsiew

    (@hwsiew)

    Great ! Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get a list of vendor’s customers’ is closed to new replies.