• Resolved alfaherbalcareshop

    (@alfaherbalcareshop)


    i need to combine first name and lastname field to one filed as name.

    also i need to remove account username in checkout, customer login to the account using phone or email

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,
    Please try this snippet of code,

    add_filter( 'woocommerce_billing_fields' , 'ced_remove_billing_fields' );
    function ced_remove_billing_fields( $fields ) {
             unset($fields['billing_last_name']);
             return $fields;
    }
    
    add_filter( 'woocommerce_checkout_fields' , 'ced_rename_checkout_fields' );
    // Change placeholder and label text
    function ced_rename_checkout_fields( $fields ) {
    $fields['billing']['billing_first_name']['placeholder'] = 'Name';
    $fields['billing']['billing_first_name']['label'] = 'Name';
    return $fields;
    }

    The first function will remove the last name, and through second filter you can rename the field according to your need.
    Thanks,

    Plugin Support kellymetal a11n

    (@kellymetal)

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this thread as resolved.

    If you have any further questions, please start a new thread.

    Have a wonderful day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘combine firstname and last name in checkout and remove username’ is closed to new replies.