• Resolved indicana35

    (@indicana35)


    Hello !

    I’m resuming @ammartello97’s post from 2 years ago.

    I copied the code from @missveronicatv into a snippet but it doesn’t work.

    Indeed, it gives the following error: Unable to create the extract. Request failed with status code 403

    I used code because I would like the member’s information to go into Woocommerce billing and shipping information when purchasing on my site.

    Can anyone tell me why this isn’t working ?

    I checked that my data corresponds to what is written in the code.

    In advance, thank you very much for your help.

    Arusha

    here is the code :

    add_filter( 'woocommerce_checkout_get_value', function( $input, $key ) {
    
        global $current_user;
    
        um_fetch_user( $current_user->ID );
        
    	switch ( $key ) :
    		case 'billing_first_name':
    		case 'shipping_first_name': return um_user( 'first_name' );
    		break;
    		
    		case 'billing_last_name':
    		case 'shipping_last_name': return um_user( 'last_name' );
    		break;
    
    		case 'billing_email': return um_user( 'user_email' );
    		break;
    
    		case 'billing_phone': return um_user( 'phone_number' );
    		break;
    
            case 'billing_country': return um_user( 'country' );
            break;
    
            case 'billing_city': return um_user( 'city');
    
    	endswitch;
        return $input;
    
    }, 10, 2);
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Auto fill billing form in checkout page from logged in users’ data’ is closed to new replies.