latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Debbie Nesbitt

Sorry, I've not written a description yet. I'll get to it soon!


Topics I'm Subscribed To

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
Getting Form Field Values

By:  Debbie Nesbitt in: Community Forum

voices: 3
replies: 9

4 years, 10 months ago  Cristián Lávaque

Full Profile Entry at Registration

By:  Debbie Nesbitt in: Community Forum

voices: 2
replies: 3

4 years, 10 months ago  Jason (Lead Developer)

Viewing 2 topics - 1 through 2 (of 2 total)

Topics I've Started

Viewing 2 topics - 1 through 2 (of 2 total)
Topic Count Last Reply
Getting Form Field Values

By:  Debbie Nesbitt in: Community Forum

voices: 3
replies: 9

4 years, 10 months ago  Cristián Lávaque

Full Profile Entry at Registration

By:  Debbie Nesbitt in: Community Forum

voices: 2
replies: 3

4 years, 10 months ago  Jason (Lead Developer)

Viewing 2 topics - 1 through 2 (of 2 total)

My Latest Replies (From Various Topics)

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Thursday Feb 23rd, 2012 at 8:39 pm #6227

Okay, I\’ve gone a different route. I must have asked my original question poorly. Sorry about that. I\’m now using the success shortcode on the PayPal Pro form (success = \”/myurl/?role=%%role%%\”)

My question now is… \”the final url does have the role value but it also has a bunch of additional information. Here is an example of what actual url that gets used:
/myurl/?role=s2member_level2&s2p-v=1330047038-e585e2adb0cc5c932dd12a3a11f76d54

Is there a way to strip off the excess stuff? I get the extra \”&s2p-v=1330047038-e585e2adb0cc5c932dd12a3a11f76d54\” even if I hardcode the success parameter like this:
\”/myurl/?role=s2member_level2\”

Any suggestions would be appreciated.

Thanks again for your help. Sorry if I wasn\’t clear on what I was trying to in the first place.

Posted: Thursday Feb 23rd, 2012 at 7:12 pm #6219

Thanks Jason. I understand your position but I\’m getting pretty frustrated. I\’ve put in the extraction hook every which way I can think of but the variables are not available. Here is one variation of the code I put into S2-hacks.php:

ID (the User\’s ID in WordPress)
$fields (an array of Custom Registration Fields for s2Member) */
}
add_action(\’user_register\’, \’dw_reg_confirm\’);
function dw_reg_confirm($user_id){
//This is the url of the page you want to show after registration
$confirm_page = \”http://wptestsite.com/osch_test_site/membership-application-submitted?\” . $role;
wp_redirect($confirm_page);
}
?>

Among other things, I\’ve also tried invoking the ws_plugin__s2member_during_configure_user_registration function from within the user_register hook (dw_reg_confirm) by adding the following line of code:
do_action (\”ws_plugin__s2member_during_configure_user_registration\”, get_defined_vars ());
but still no variables.

I\’ve spent a few hours looking through functions in the codex documentation but I\’m not making any progress. I understand you can\’t help me code but can you give me any hints? I will figure it out eventually but I\’m hoping you can save me a bunch of time by pointing me in the right direction.

Posted: Tuesday Feb 21st, 2012 at 9:28 am #5862

Thanks Jason! This looks like exactly what I’m looking for. At the risk of exposing my ignorance, how do I tie the new hook in with the redireciton hook?

Thanks again. Your help is very much appreciated.

Posted: Monday Feb 20th, 2012 at 2:25 pm #5708

An update… The S2Member registration process passes $user_id to the user_register function. Within the user_register function which Ive tweaked via code in S2-Hacks.php, I’ve tried querying the database based on user_id. But the results are either empty fields or values that don’t match the final results. Here is the code within S2-hacks.php:

function dw_reg_confirm($user_id) {
    //This is the url of the page you want to show after registration.

    //Get user role based on the user ID of the person who just completed and submitted a registration form 
    $user = new WP_User($user_id)
    $role = $user->roles[0];

    //Build the confirmation page URL and add role value as passed parameter
    $confirm_page = “http://fakesite.com/membership-application-submitted?" . $role;
 
    wp_redirect($confirm_page);
}
 
add_action(‘user_register’, ‘dw_reg_confirm’);

In this case the roles[0] value returned is ‘Subscriber’ instead of the final value which should be s2member_level2. When I use the same code on a normal WP page (manually entering the user id that was just registered), I get the expected value of ‘s2member_level2’ so it appears that sometime after invoking the user_register function and passing control to the redirect URL, S2 updates the roles[0] value from ‘ Subscriber’ to the appropriate value.

So…. the question remains… Within the user_register function, armed with the user id value, is there any way to find out what level of registration profile the user just completed?

One piece of additional informaton, I’m using the PayPal Pro forms for each level but I’m not using PayPal for any of the levels (payment is solicited on the registration confirmation page). As an example, here is the code for a level 2 registration:

[s2Member-Pro-PayPal-Form register="1" level="2" ccaps="" desc="$40 for one year membership" custom="dimpled-orb.com" tp="0" tt="D" captcha="clean" /]
Posted: Saturday Feb 18th, 2012 at 1:34 am #5571

The person is not logged in when they register and the registration process does not log them in so I don’t think any of the ‘CURRENT_USER’ related constants will work. I tested a registration process using the level 2 form. The value of S2MEMBER_CURRENT_USER_ACCESS_LEVEL in the dw-reg-confirm function was ‘-1’. I would have expected it to be a ‘2’ so I think my suspicion about the constants only being viable for logged in users is correct.

Another way of asking my question….. how can I programmatically access the %%xxxxxxx%% constants that are available when customizing the new user mail message and the administrative new user notifcation message. Those constants seem to reflect the values entered into the registration form which is what I’m looking for.

Thanks.

Posted: Friday Feb 10th, 2012 at 12:29 pm #4744

Logging out before testing made all the difference. Thank you for your help.

Viewing 6 replies - 1 through 6 (of 6 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.