Community Support Forums — WordPress® ( Users Helping Users ) — 2011-10-01T21:28:34-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14980 2011-10-01T21:28:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=42115#p42115 <![CDATA[Re: Separate Billing name and Username]]> Yes, this is possible, but it's not super simple.

FYI: s2Member has no restriction that absolutely says the Billing Name MUST be the same as what's on the card. But if you really want to differentiate the two, feel free to continue with these instructions.

First, you will need to create a Custom Registration Field with s2Member that collects a separate name during checkout. A name that will be used on the actual Membership account, since you want that to be differentiated.

Now, create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
( this will handle post-processing of your Custom Registration Field, assuming it's ID is `child_name` )
Code:
<?php
add_action 
("ws_plugin__s2member_during_configure_user_registration_front_side", "my_custom_name_handler");
function my_custom_name_handler ($vars = array ())
    {
        if (($user_id = $vars["user_id"]) && !empty ($_POST["s2member_pro_authnet_checkout"]["custom_fields"]["child_name"]))
            {
                // Get full name of Child, this will be used on the account.
                $full_display_name = esc_html ($_POST["s2member_pro_authnet_checkout"]["custom_fields"]["child_name"]);
                // Break full name apart at the first space in the full name, to get a first/last name.
                list ($first_name, $last_name) = preg_split ("/ +/", $full_display_name, 2);
                // Update this new account, using the name that I collected with Custom Reg Field ID: `child_name`.
                wp_update_user (array ("ID" => $user_id, "first_name" => $first_name, "last_name" => $last_name, "display_name" => $full_display_name));
            }
    }
?>
See also: http://codex.wordpress.org/Function_Ref ... pdate_user

Statistics: Posted by Jason Caldwell — October 1st, 2011, 9:28 pm


]]>
2011-09-28T09:36:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=41843#p41843 <![CDATA[Re: Separate Billing name and Username]]> Statistics: Posted by MODassic — September 28th, 2011, 9:36 am


]]>
2011-09-28T03:42:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=41804#p41804 <![CDATA[Re: Separate Billing name and Username]]> Statistics: Posted by Cristián Lávaque — September 28th, 2011, 3:42 am


]]>
2011-09-26T15:05:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=39218#p39218 <![CDATA[Re: Separate Billing name and Username]]> Statistics: Posted by MODassic — September 26th, 2011, 3:05 pm


]]>
2011-09-26T14:48:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=39214#p39214 <![CDATA[Re: Separate Billing name and Username]]> WP Admin -> s2Member -> General Options -> Custom Registration -> Add New Field

Statistics: Posted by Cristián Lávaque — September 26th, 2011, 2:48 pm


]]>
2011-09-12T19:28:04-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=34639#p34639 <![CDATA[Re: Separate Billing name and Username]]>
However, before you start coding, try playing around with the settings under Dashboard -> s2Member -> General Options -> Custom Registration Fields/Options -> Set "Display Name" during Registration?

I think that the setting "Yes (set Display Name to User's Username)" or "No" Might work for you.

Cheers!

Statistics: Posted by Bruce C — September 12th, 2011, 7:28 pm


]]>
2011-09-12T13:54:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14980&p=34607#p34607 <![CDATA[Separate Billing name and Username]]>
We are using the auth.net gateway, and I have already copied the forms.html into my theme directory to customize those fields, but I am a little confused on how to seperate the name out, I can create the fields, but I'm not sure where to go to non destructively edit how those fields are processed.

Any response would be appreciated, even if its a, you cant do that, or thats going to take serious work.

Thanks,
-Taylor

Statistics: Posted by MODassic — September 12th, 2011, 1:54 pm


]]>