WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. buchey
    Member
    Posted 1 year ago #

    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!

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

  2. buchey
    Member
    Posted 1 year 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 ] ) ) ;
    						break;
    						case "billing_first_name" :
    							wp_update_user( array ( 'ID' => $this->customer_id, 'first_name' => $this->posted[ $key ] ) ) ;
    						break;
    						case "billing_last_name" :
    							wp_update_user( array ( 'ID' => $this->customer_id, 'last_name' => $this->posted[ $key ] ) ) ;
    						break;
    					}
    				}*/

    Nice Weekend!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.