BuddyDev

Search

[Resolved] How can I follow my affiliateWP referrer?

  • Participant
    Level: Initiated
    Posts: 7
    Renaat Sioncke on #43355

    Is it possible with BuddyPress Auto Friendship Pro to make my list based on my AffiliateWP referrers?

    I use a BuddyBoss community that is only accessible if you are referred with an AffiliateWP referrer.

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #43363

    Hi Renaat,
    Welcome to BuddyDev.

    Out of the box, this is not available in the Auto Friendship pro plugin.

    How is the affiliate marked for a user in affiliate WP for a newly registered user? If you can link us to any document and provide access to the affiliateWP plugin, Our team can assist with it.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Renaat Sioncke on #43403
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #43444
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 7
    Renaat Sioncke on #43449

    Thank you, looking forward to the reply.
    The lifetime referrer is stored in the user’s WordPress profile.

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #43452

    Hello Renatt,

    I have a plugin that can achieve this if interested

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #43453

    Hello Renatt,

    Kindly see screenshot for the plugin settings

    https://ibb.co/cCJJZhG
    https://ibb.co/grLq1Rz
    https://ibb.co/58q7cSq
    https://ibb.co/cxqP8Y5

    If the plugin meets your requirements you can message me at mediapress.development[at]gmail.com

  • Participant
    Level: Initiated
    Posts: 7
    Renaat Sioncke on #43455

    I hope to achieve this as simple as possible. I am not building my own affiliate network. But, yes, it is a plugin to integrate AffiliateWP. I tested the plugin before, and I am looking for other options. And BuddyDev seems to have a responsive support. Thanks for the suggestion. BTW are you connected with BuddyDev?

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #43459

    Hello Renatt,

    No im not connected to buddydev im customer just like you.

    Thanks have a great day

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #43479

    Hello Renatt,

    Try the following code. It will make the user to auto-follow referer user when the referral status changes to complete.

    
    add_action( 'affwp_complete_referral', function ( $referral_id ) {
    
    	if ( ! function_exists( 'affwp_get_referral_by' ) || ! function_exists( 'bp_is_following' ) ) {
    		return;
    	}
    
    	//$customer_id = bp_loggedin_user_id();
    	$referral = affwp_get_referral( $referral_id );
    
    	// Should we also need to check the status of referral.
    	if ( ! $referral || ! $referral->affiliate_id || ! $referral->customer_id ) {
    		return;
    	}
    
    	$affiliate_user_id = affwp_get_affiliate_user_id( $referral->affiliate_id );
    	$customer          = affwp_get_customer( $referral->customer_id );
    
    	if ( ! $customer ) {
    		return;
    	}
    
    	$args = array(
    		'leader_id'   => $affiliate_user_id,
    		'follower_id' => $customer->user_id,
    	);
    
    	if ( ! bp_is_following( $args ) ) {
    		bp_start_following( $args );
    	}
    }, 100 );
    
    

    Regards
    Ravi

The topic ‘ [Resolved] How can I follow my affiliateWP referrer?’ is closed to new replies.

This topic is: resolved