Support » Plugins and Hacks » [Resolved] disable saving user data

[Resolved] disable saving user data

  • Hello,

    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!


Viewing 1 replies (of 1 total)
  • 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!

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] disable saving user data’ is closed to new replies.