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

Getting one time registrations to work with S2member proforms

by

Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › WP Affiliate General Questions › Getting one time registrations to work with S2member proforms

Tagged: s2member registration

  • This topic has 10 replies, 2 voices, and was last updated 10 years, 9 months ago by admin.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • July 21, 2014 at 8:25 am #11213
    georgef
    Member

    Hi, I am trying to get the automatic registration to work when users sign up on my site. Problem is that I am using S2Members proforms to register, so not the traditional way of registering on the site.

    Hw can I still get the automatic registration to work when members register through S2member proforms? Also want to have a single sign on scenario (I assume the above would fix that)

    July 21, 2014 at 11:13 pm #64497
    admin
    Keymaster

    Do they use the standard WordPress registration hooks after a user registers?

    July 23, 2014 at 8:34 am #64498
    georgef
    Member

    This is the shortcode the Paypal Pro forms generate:

    [s2Member-Pro-PayPal-Form level=”1″ ccaps=”” desc=”14 Days free / then $27 USD / Monthly (recurring charge, for ongoing access)” ps=”paypal” lc=”” cc=”USD” dg=”0″ ns=”1″ custom=”dev.thatmlmbeat.com” ta=”0″ tp=”14″ tt=”D” ra=”27″ rp=”1″ rt=”M” rr=”1″ rrt=”” rra=”2″ accept=”paypal,visa,mastercard,amex,discover,maestro,solo” accept_via_paypal=”paypal” coupon=”” accept_coupons=”0″ default_country_code=”” captcha=”0″ /]

    July 23, 2014 at 11:10 pm #64499
    admin
    Keymaster

    I am not sure about what that shortcode does. This is a question you will need to ask the s2member support I think. Ask them the following question:

    Do you use the standard WordPress registration hook after a user registers? If not, what hook do you fire? Is there any documentation on it?

    July 24, 2014 at 10:31 pm #64500
    georgef
    Member

    OK, I had someone reply to me that apparently had the same problem, but must admit I’m not too clear what to do. Here is his answer:

    I’ve also had problems with this one. The devs tell me that the ‘user_register’ hook should always be fired. However, during my testing I couldn’t for the life of me get it to fire during a pro-form registration.

    My solution (as I needed a custom redirect anyway) was to attach a filter to ‘ws_plugin__s2member_login_redirect’ that calls the WP-Affiliate functions accordingly. I won’t list my code here as it does a lot more and is probably overly complex. However for reference the functions you will need to call are:

    handle_wp_user_login – For logging the user into the affiliate platform (assuming the id’s match)

    wp_aff_handle_wp_user_registration – for registering the user as an affiliate.

    Not saying this is the best way, but it works.

    Hope it helps!

    July 24, 2014 at 11:31 pm #64501
    admin
    Keymaster

    I think the tweak in the following post should do it:

    https://support.tipsandtricks-hq.com/forums/topic/automatically-log-into-affiliate-account-not-working-for-wp-role-subscriber#post-42108

    July 25, 2014 at 8:39 am #64502
    georgef
    Member

    Thanks, no luck though :(

    I just created a test account with Sandbox, account registered fine but doesn’t create the affiliate registration.

    Anything else I could be missing?

    This is my s2-hacks.php file:

    <?php

    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= $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);

    }

    }

    ?>

    July 25, 2014 at 3:15 pm #64503
    georgef
    Member

    Just looking at the title of the post you sent for the s2hacks, Automatically Log into Affiliate Account not working for WP Role Subscriber…

    My roles aren’t Subscriber, they are different levels that I have created with S2member.

    Does that make a difference?

    July 25, 2014 at 11:49 pm #64504
    admin
    Keymaster

    I am not very familiar with s2member plugin code so sorry for not being able to give you an accurate answer.

    The hack I shared is only for the user login action I think (it doesn’t account for the account creation).

    We really need to know what action hook the s2member pro-form will trigger when a user is registered. Then I can give you a good answer. At the moment, it is definitely not triggering the standard WordPress’s registration hook. So please ask them that question.

    July 29, 2014 at 6:02 am #64505
    georgef
    Member

    OK, here is the response from support:

    “The user_register hook in WordPress is always fired during a Pro Form submission when there is a new customer. s2Member calls upon wp_create_user() which calls upon wp_insert_user(), which fires user_register. s2Member does in fact handle the registration of a customer via the user_register hook.”

    July 30, 2014 at 4:53 am #64506
    admin
    Keymaster

    Thank you for that. I am going to try a little tweak. I have sent you an update via email. Please let me know if that helps.

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.
Log In

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