Retrieving the customer's information on payment checkout

I am doing some custom coding in the paypal-express.php, and I want to be able to retrieve the customer's information (e.g. name, telephone number). I've tried with the following code but it doesn't work..any help?

$sql = "SELECT * FROM wp_".$bid."_posts where post_title = '".$orderId."'";
$getProducts = $wpdb->get_row($sql,ARRAY_A);
$productDetails = $getProducts;
$cId = $productDetails['post_author'];
$customerDetails = get_userdata( $cId );
$customerName = $customerDetails->user_login;
$billingSerialize = get_user_meta($cId,'mp_shipping_info',true);
$customerBillingAddress = $billingSerialize['address'];
$customerBillingPhone = $billingSerialize['phone'];

  • Bob

    Yes it's regarding marketpress. I tried to mark it as 'marketpress' and 'general' but it wouldn't allow me to change it. It kept defaulting to 'HTML Email Templates;.

    Yes i am running a multisite which has 10 shops. When a customer gets to the checkout and buys items from these stores, I want to be able to retrieve the customer information - which is what the customer enters in the "Shipping" step at the checkout. I just want to know how I can get the customer name and telephone number to begin with.

    The code that i showed above works if the customer creates an account with the global shop. But if the customer does a 1 time checkout and doesn't create an account then my code doesn't retrieve the customer info.

  • Michael Bissett

    Hey @Bob, sure do appreciate your patience here! :slight_smile:

    No worries about the plugin you marked for the question, I've taken care of changing that for you. :slight_smile:

    As to your question, could you elaborate on where this information is being stored? You question reminds me of the "MP Custom Shipping Form" plugin (which you can find here), but I get the feeling that your question has a different thought in mind.

    Hope you're having a great weekend so far! :slight_smile:

    Kind Regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.