- This topic has 18 replies, 4 voices, and was last updated 8 years, 9 months ago by .
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Affiliate ID/field included in registration page to manually set the affiliate
Tagged: affiliate code, WP Affiliate
Got an idea! What if we uncheck the Automatically Create Affiliate Account checkbox in WP User Settings and create affiliate account manually from the filter after the standard registration is successfully completed? If so, what function do I need for this?
That should work fine.
Here is an example code block to show you how you could create an affiliate entry from your function:
$user_id= "2";//TODO - set the correct WP user ID value
$user_info = get_userdata($user_id);
$fields = array();
$fields['refid'] = $user_info->user_login;
$fields['pass'] = $user_info->user_pass;
$fields['email'] = $user_info->user_email;
$fields['firstname'] = $user_info->first_name;
$fields['lastname'] = $user_info->last_name;
$fields['date'] = (date ("Y-m-d"));
$fields['commissionlevel'] = get_option('wp_aff_commission_level');
$fields['referrer'] = wp_affiliate_get_referrer();//TODO - set the referrer value here.
wp_aff_create_affilate_using_array_data($fields);
Thanks a lot. I’ll give it a try an get back to you with the results ))
Did this ever work? I’m having the same problem