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™
<?php
if (!empty ($_POST['s2member_pro_authnet_checkout[street]']))
{
//Will catch values on the submission of the Pro form ( only for Authorize.net )
$billingvalue = $_POST['s2member_pro_authnet_checkout[street]'] . "\r\n" . $POST['s2member_pro_authnet_checkout[city]'] . ', ' . $_POST['s2member_pro_authnet_checkout[state]'] . ' ' . $_POST['s2member_pro_authnet_checkout[zip]'];
//Set a cookie for after checkout
setcookie('custom_billing_address_value', $billingvalue);
}
?>
<?php
function billing_user_meta ($id)
{
add_user_meta ($id, 's2member_billing_address', $_COOKIE['custom_billing_address_value']);
}
add_action ('user_register', 'billing_user_meta');
?>
Yes, you may need to implement a custom routine of your own for this though. I'm attaching a sample script that might assist you in this regard. Please feel free to follow-up if you have other questions about how this sample script works.I know that the billing address is not stored on the Wordpress database. Is there any way I can get an address to pre-populate from the billing address using either Authorize or PayPal Pro?
<?php
add_action ("ws_plugin__s2member_during_configure_user_registration_front_side_paid", "my_s2_pro_form_processor");
function my_s2_pro_form_processor ($vars = array ())
{
$user_id = /* Grab User's new ID in WordPress®. */ $vars["user_id"];
/**/
if (isset /* PayPal Checkout. */ ($_POST["s2member_pro_paypal_checkout"]))
$s2_co_vars = $_POST["s2member_pro_paypal_checkout"];
/**/
else if /* Or, this for Authorize.Net. */ (isset ($_POST["s2member_pro_authnet_checkout"]))
$s2_co_vars = $_POST["s2member_pro_authnet_checkout"];
/**/
if (isset ($s2_co_vars) && is_array ($s2_co_vars) && ($s2_co_vars = c_ws_plugin__s2member_utils_strings::trim_deep (stripslashes_deep ($s2_co_vars))))
{
/* Original Shortcode Attributes for the Pro Form. Might be useful in some cases. */
$s2_sc_attrs = unserialize (c_ws_plugin__s2member_utils_encryption::decrypt ($s2_co_vars["attr"]));
/**/
$email = $s2_co_vars["email"];
$username = $s2_co_vars["username"];
$first_name = $s2_co_vars["first_name"];
$last_name = $s2_co_vars["last_name"];
/**/
$custom_fields = /* Array of all Custom Fields. */ $s2_co_vars["custom_fields"];
/**/
$customer_age = /* Now, a specific Custom Field. */ $custom_fields["customer_age"];
/* Use the Unique ID you gave a Custom Registration Field ( ex: `customer_age` ). */
/**/
$card_type = $s2_co_vars["card_type"];
$card_number = $s2_co_vars["card_number"];
$card_expiration = $s2_co_vars["card_expiration"];
$card_verification = $s2_co_vars["card_verification"];
$card_start_date_issue_number = $s2_co_vars["card_start_date_issue_number"];
/**/
$street = $s2_co_vars["street"];
$city = $s2_co_vars["city"];
$state = $s2_co_vars["state"];
$country = $s2_co_vars["country"];
$zip = $s2_co_vars["zip"];
/**/
/* Now you might store information of your own. */
/* http://codex.wordpress.org/Function_Reference/update_user_option */
update_user_option ($user_id, "customer_age", $customer_age);
/**/
/* You might retrieve this in the future with this function. */
/* http://codex.wordpress.org/Function_Reference/get_user_option */
$customer_age = get_user_option ("customer_age", $user_id);
}
}
?>
update_user_option ($street, "customer_street", $customer_street);
update_user_option ($city, "customer_city", $customer_city);
update_user_option ($state, "customer_state", $customer_state);
update_user_option ($zip, "customer_zip", $customer_zip);
While it's true that you can hack this in, making it possible with s2Member, it's not something that the current release of s2Member makes possible in a default installation. The storage of this personally identifiable information; including, but not limited to CC numbers, expiration dates, street, city, state, zip; is intentionally stored within your Payment Gateway, and NOT within WordPress.colinp386 wrote:Seems to me that the lack of an option to pre-populate basic CC information (street, city, state, zip) from a members profile is strangely lacking. Is this on your to-do list?
If not a little more help would be appreciated.
I think you mean "First/Last Name". Yes, this is a known issue. We are working to improve this for a future release. The Billing First/Last Name will go into the Customer's profile for WordPress. While it's possible for a Customer to change this after logging in the the first time, ideally we would give the Customer a chance to use separate billing details during checkout.In addition (perhaps a new topic) The billing forms don't give the option to have a different User Name to Billing Name. This is going to cause an issue for our Corporate clients who often use a colleagues Corp. Credit Card to bill our services.
Return to Common Questions/Problems/Tips
Users browsing this forum: No registered users and 0 guests