WooCommerce - excelling eCommerce
[resolved] disable saving user data (2 posts)

  1. buchey
    Posted 2 years ago #


    I'm working on a shop for our coworkers. So it won't go online.
    For this case I would like to add one "shop"-user with blank names and blank E-Mail (or something like change-your-mail@example.org).

    If we go like this, one customer logs in with the shop-user, adds products to his cart and checkout. But here is the problem. He adds in the blank fields "Max Mustermann" and a E-Mail, orders his products and then "Max Mustermann" is saved as name for the shop-user.
    So if the next guy comes up to checkout with the same user, he will get displayed who ordered before him.

    Is there a checkbox, which i can't find, to disable this function or where else could this issue be solved.

    Thanks for replies!


  2. buchey
    Posted 2 years ago #

    Found solution by myself:

    Uncommented in my class-wc-checkout.php the "user" lines:

    				// User
    				if ( $this->customer_id && ! empty( $this->posted[ $key ] ) ) {
    					update_user_meta( $this->customer_id, $key, $this->posted[ $key ] );
    					// Special fields
    					switch ( $key ) {
    						case "billing_email" :
    							if ( ! email_exists( $this->posted[ $key ] ) )
    								wp_update_user( array ( 'ID' => $this->customer_id, 'user_email' => $this->posted[ $key ] ) ) ;
    						case "billing_first_name" :
    							wp_update_user( array ( 'ID' => $this->customer_id, 'first_name' => $this->posted[ $key ] ) ) ;
    						case "billing_last_name" :
    							wp_update_user( array ( 'ID' => $this->customer_id, 'last_name' => $this->posted[ $key ] ) ) ;

    Nice Weekend!

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


No tags yet.