WordPress.org

Forums

WooCommerce - excelling eCommerce
How to update billing_email when user_email is updated (1 post)

  1. hazemmaher92
    Member
    Posted 1 year ago #

    I'm trying to achieve two way synchronization between user_email and billing_email (the key for woocommerce emails). So far, I have it working that when a customer edits/updates their billing email address their user_email gets updated with the following code:

    add_action( 'woocommerce_customer_save_address','isa_customer_save_address', 10, 1);

    function isa_customer_save_address() {

    global $woocommerce;
    $user_id = get_current_user_id();

    wp_update_user( array ( 'ID' => $user_id, 'user_email' => $_POST['billing_email'] ) ) ;

    }
    Now how do I update a customer's billing_email when they edit/updates their user_email?

    http://wordpress.org/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic