PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Separate Billing name and Username

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Separate Billing name and Username

Postby MODassic » September 12th, 2011, 1:54 pm

Hello, I have a client that has determined that the checkout process must have a way for users to fill out a billing name that is unrelated to the name of the account. This seems like a question that you guys may have encountered before, I can't find any references to it, but I was hoping you had some advice.

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
User avatar
MODassic
Registered User
Registered User
 
Posts: 13
Joined: August 31, 2011

Re: Separate Billing name and Username

Postby Bruce C » September 12th, 2011, 7:28 pm

That doesn't sound too complicated, as I think WordPress has a feature to handle this (Nickname).

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!
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: Separate Billing name and Username

Postby Cristián Lávaque » September 26th, 2011, 2:48 pm

Would custom registartion fields work for you to do this? WP Admin -> s2Member -> General Options -> Custom Registration -> Add New Field
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Separate Billing name and Username

Postby MODassic » September 26th, 2011, 3:05 pm

We are already using those, this is something separate. Say a minor want to sign up and use their parents card, we want to split up name and billing name to make that possible without having to go back and change things after checkout.
User avatar
MODassic
Registered User
Registered User
 
Posts: 13
Joined: August 31, 2011

Re: Separate Billing name and Username

Postby Cristián Lávaque » September 28th, 2011, 3:42 am

I emailed Jason asking him about this.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Separate Billing name and Username

Postby MODassic » September 28th, 2011, 9:36 am

thanks
User avatar
MODassic
Registered User
Registered User
 
Posts: 13
Joined: August 31, 2011

Re: Separate Billing name and Username

Postby Jason Caldwell » October 1st, 2011, 9:28 pm

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: Select all
<?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
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron