Community Support Forums — WordPress® ( Users Helping Users ) — 2011-11-05T22:33:36-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=15774 2011-11-05T22:33:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=52345#p52345 <![CDATA[Re: Auto Login On PayPal Return?]]>

Statistics: Posted by Cristián Lávaque — November 5th, 2011, 10:33 pm


]]>
2011-11-04T14:09:39-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=51040#p51040 <![CDATA[Re: Auto Login On PayPal Return?]]> Statistics: Posted by ryanseo — November 4th, 2011, 2:09 pm


]]>
2011-11-04T14:00:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=51038#p51038 <![CDATA[Re: Auto Login On PayPal Return?]]>

Make sure the user gets the emails too (new user and payment confirmation).

Statistics: Posted by Cristián Lávaque — November 4th, 2011, 2:00 pm


]]>
2011-11-04T09:04:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=51012#p51012 <![CDATA[Re: Auto Login On PayPal Return?]]>
Thank you very much sir.

Code:
add_action ('ws_plugin__s2member_during_configure_user_registration', 's2_auto_login_after_registration');
function s2_auto_login_after_registration($vars = array()) {
    if (!is_admin() && $vars['processed'] === 'yes') {
        wp_set_auth_cookie($vars['user_id'], false, is_ssl());
        wp_redirect('urltoredirectto');
        exit();
    }
}


Worked perfectly and I receive notifications like I should be, good eye and thanks again.

Statistics: Posted by ryanseo — November 4th, 2011, 9:04 am


]]>
2011-11-04T00:30:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=50982#p50982 <![CDATA[Re: Auto Login On PayPal Return?]]> viewtopic.php?f=4&t=14211

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — November 4th, 2011, 12:30 am


]]>
2011-11-03T23:08:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=50967#p50967 <![CDATA[Re: Auto Login On PayPal Return?]]> Statistics: Posted by Eduan — November 3rd, 2011, 11:08 pm


]]>
2011-11-03T21:36:47-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=50960#p50960 <![CDATA[Re: Auto Login On PayPal Return?]]>
Adding this into your theme's function files will set a cookie for you and automatically log you in after registering and returning back from a successful PayPal membership purchase (since the registration uses built in WP registration functionality):

Code:
function auto_login_new_user( $user_id )
    {
      wp_set_auth_cookie( $user_id, false, is_ssl() );
    }
add_action( 'user_register', 'auto_login_new_user' );


Hope this helps someone who also needs this kind of functionality.

**Note: Not sure if this works with s2member non-pro forms as I'm utilizing the Pro Forms but if it uses the same wp registration functionality then it should absolutely work for non-pro members as well.

Statistics: Posted by ryanseo — November 3rd, 2011, 9:36 pm


]]>
2011-11-03T20:44:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=15774&p=50954#p50954 <![CDATA[Auto Login On PayPal Return?]]> Statistics: Posted by ryanseo — November 3rd, 2011, 8:44 pm


]]>