Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration
You are here: Home

dirkkirchner

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 17, 2012 at 9:33 am in reply to: Automatically Log into Affiliate Account not working for WP Role Subscriber #51355
    dirkkirchner
    Member

    Here is what I did.

    Code:

    Code:
    add_action(“ws_plugin__s2member_before_login_redirect”, “login_to_wp_affiliate_platform”);
    function login_to_wp_affiliate_platform($vars = array())
    {
    $username = $vars [username];
    wp_affiliate_log_debug(“WP User Integration – attempting to log this user into the affiliate account. Username: “.$username,true);
    if(wp_aff_check_if_account_exists_by_affiliate_id($username)){
    $_SESSION[‘user_id’]= $username;
    setcookie(“user_id”, $username, time()+60*60*6, “/”,COOKIE_DOMAIN); //set cookie for 6 hours
    wp_affiliate_log_debug(“Found a corresponding affiliate account for this WP User! Logging the user into affiliate account.”,true);
    }else{
    wp_affiliate_log_debug(“No corresponding affiliate ID exists for this WP User (“.$username.”) so can’t log this user in!”,true);
    }
    }

    This code goes into a file named s2-hacks.php in the folder wp-content/mu-plugins (this ist a WordPress folder for ‘must use’ plugins. If you dont have such a folder, just create one).

    After the log in routine is completed by the s2member plugin there ist a hook called ws_plugin__s2member_before_login_redirect. I added an action / function called login_to_wp_affiliate_platform to this hook.

    Works fine and I hope this is helpful for other users.

    November 16, 2012 at 2:46 pm in reply to: Automatically Log into Affiliate Account not working for WP Role Subscriber #51353
    dirkkirchner
    Member

    Ok. I found a solution.

    s2member has a hook called ws_plugin__s2member_before_login_redirect.

    I use this to run a similar function as your handle_wp_user_login and it works very well.

    If you want I can post the complete code here.

    Thank you very much.

    November 16, 2012 at 8:40 am in reply to: Automatically Log into Affiliate Account not working for WP Role Subscriber #51352
    dirkkirchner
    Member

    Thank you. It is definitely the s2member-plugin. I’ll have a look if they have a hook in or after their login routines and if I can use that.

    November 14, 2012 at 9:16 am in reply to: Automatically Log into Affiliate Account not working for WP Role Subscriber #51350
    dirkkirchner
    Member

    The two lines are not getting printed when I log in with a subscriber user role.

    I’m using the standard WordPress log in but I think it is contlolled by s2member.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ