Get affiliate info in template without shortcode

Hi,

how can i get an affiliate data, like name, username, email… to display in my template by using his affiliate id? and how can i get that data to use in a action?

couldn´t find in the documentation

thanks


Comments

3 responses to “Get affiliate info in template without shortcode”

  1. George Avatar

    You are welcome Bruno!

  2. Great, thank you very much!

  3. George Avatar

    Hi Bruno,

    Since you have the affiliate id, you can use something like this snippet to display the affiliate data:

    $affiliate_id = 1;
    $current_user_id = affiliates_get_affiliate_user( $affiliate_id );
    $current_user = get_user_by( 'ID', $current_user_id );
    if ( $current_user ) {
    echo 'Username: ' . $current_user->user_login . '';
    echo 'User email: ' . $current_user->user_email . '';
    }

    The plugin API can be found here.
    Kind regards,
    George

Share