Home Forums Theme Support Dokan change first name and last name to company name

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  towhid 4 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #43688

    obiora
    Member
    Post count: 57

    how do i replace change first name and last name to company name in the seller registration form

    #43691

    towhid
    Participant
    Post count: 4505

    Hello Obiora,

    If you change the two filed into a one filed and for this you need customization.

    Here is the code of change the first name and last name field:

    Please navigate to dokan-plugin/includes/template-tags.php and find below lines of code and change whatever you want

    <p class="form-row form-group">
                    <label for="first-name"><?php _e( 'First Name', 'dokan' ); ?> <span class="required">*</span></label>
                    <input type="text" class="input-text form-control" name="fname" id="first-name" value="<?php if ( ! empty( $_POST['fname'] ) ) echo esc_attr($_POST['fname']); ?>" required="required" />
                </p>
    
                <p class="form-row form-group">
                    <label for="last-name"><?php _e( 'Last Name', 'dokan' ); ?> <span class="required">*</span></label>
                    <input type="text" class="input-text form-control" name="lname" id="last-name" value="<?php if ( ! empty( $_POST['lname'] ) ) echo esc_attr($_POST['lname']); ?>" required="required" />
                </p>

    Thank you ๐Ÿ™‚

    #43694

    obiora
    Member
    Post count: 57

    it changed in the form.. but in account (edit details) it still shows first name and last name.
    how do i rename it there thank you

    #43705

    towhid
    Participant
    Post count: 4505

    Please open plugins/woocommerce/templates/myaccount/form-edit-account.php find below lines of code and change whatever you want.

    <p class="form-row form-row-first">
    		<label for="account_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label>
    		<input type="text" class="input-text" name="account_first_name" id="account_first_name" value="<?php echo esc_attr( $user->first_name ); ?>" />
    	</p>
    	<p class="form-row form-row-last">
    		<label for="account_last_name"><?php _e( 'Last name', 'woocommerce' ); ?> <span class="required">*</span></label>
    		<input type="text" class="input-text" name="account_last_name" id="account_last_name" value="<?php echo esc_attr( $user->last_name ); ?>" />
    	</p>

    Thank you ๐Ÿ™‚

    #43741

    obiora
    Member
    Post count: 57

    done that. the last place is on the account migration form
    for a customer wanting to become a seller. thank you

    #43746

    towhid
    Participant
    Post count: 4505

    Please navigate to dokan-plugin/includes/template-tags.php and find below lines of code and change whatever you want
    <a href="<?php echo dokan_get_page_url( 'myaccount', 'woocommerce' ); ?>account-migration/seller/" class="button button-primary"><?php _e( 'Become a Seller', 'dokan' ); ?></a>

    Thank you ๐Ÿ™‚

    #43749

    obiora
    Member
    Post count: 57

    i meant that the first name last name does not obey the above changes at the migration form where the customer wants to become a seller.

    #43751

    towhid
    Participant
    Post count: 4505

    Please navigate to dokan-plugin/templates/update-account.php and find below lines of code and change whatever you want

    <p class="form-row form-group">
                    <label for="first-name"><?php _e( 'First Name', 'dokan' ); ?> <span class="required">*</span></label>
                    <input type="text" class="input-text form-control" name="fname" id="first-name" value="<?php if ( ! empty( $f_name ) ) echo esc_attr( $f_name ); ?>" required="required" />
                </p>
    
                <p class="form-row form-group">
                    <label for="last-name"><?php _e( 'Last Name', 'dokan' ); ?> <span class="required">*</span></label>
                    <input type="text" class="input-text form-control" name="lname" id="last-name" value="<?php if ( ! empty( $l_name ) ) echo esc_attr( $l_name ); ?>" required="required" />
                </p>

    Thank you ๐Ÿ™‚

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘change first name and last name to company name’ is closed to new replies.