Viewing 2 replies - 1 through 2 (of 2 total)
  • Jeasy

    (@jeasysehgal)

    Can anyone confirm if this plugin actually would work with woocommerce 2.1.3

    I used the following code in my theme’s (or child theme) functions.php

    add_action( 'woocommerce_before_customer_login_form', 'wsl_render_login_form_login_form' );
    add_action( 'woocommerce_before_checkout_form', 'wsl_render_login_form_login_form' );
    
    // Hook in
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    
    // Our hooked in function - $fields is passed via the filter!
    function custom_override_checkout_fields( $fields ) {
    	$current_user = wp_get_current_user();
    	$fields['billing']['billing_first_name']['default'] = $current_user->user_firstname;
    	$fields['billing']['billing_last_name']['default'] = $current_user->user_lastname;
     	return $fields;
    }
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Woocommerce – does it work?’ is closed to new replies.