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
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
Follow us! We post news and tutorials related to our tools, WordPress and WooCommerce on these platforms:
You are welcome Bruno!
Great, thank you very much!
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