Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How to make Registration Email as Billing Email in Woocommece? WordPress

  • SOLVED

This is my case: In my Woocommerce, there are two emails: first is for username (in registration page) and second is the email in Billing (checkout page) where all order-details/receipts are sent to that Billing email.

What I want is when a user type their email as username in registration page, the email will also be used as Billing email (used for receipt/order detail emails).

I managed to hide the email field in Billing Page using "unset", but if I hide the email field I'm NOT sure if the details/receipt are also sent to my username email? And If I "unset" the email field, will the user NOT get any details/receipt emails at all?

Answers (2)

2015-06-03

Francisco Javier Carazo Gil answers:

You can create a function that assigns this metadata in registering process. I tell you know how with code.


Francisco Javier Carazo Gil comments:

Look at it:


add_action( 'user_register', 'myplugin_registration_save', 10, 1 );

function myplugin_registration_save( $user_id ) {

$new_user = get_user_by( 'id', $user_id );
update_user_meta($user_id, 'billing_email', $new_user->user_email );

}


rprabowo comments:

thanks, both answers work.

2015-06-03

Navjot Singh answers:

Try this?

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
$current_user = wp_get_current_user();
$fields['billing']['billing_email']['default'] = $current_user->user_email;
return $fields;
}


[[LINK href="http://uploadwp.com/community/index.php?threads/woocommerce-checkout-field-billing-email-to-be-display-only.524/"]]Source[[/LINK]]