• Resolved soumaan

    (@soumaan)


    I want to add new input field (Agent ID) upon seller registration

    I have written the code which is here below and I added it on the dokan lite plugin file – wp-content/plugins/dokan/templates/global/seller-registration-form.php but it isn’t displaying on the frontend

    Here is the code I added

    <p class=”form-row form-group form-row-wide”>
    <label for=”agent-id”><?php esc_html e( ‘Agent ID’, ‘dokan-lite’ ); ?><span class=”required”>*</span></label>
    <input type=”text” class=”input-text form-control” name=”agent_id” id=”agent-id” value=”<?php if ( ! empty( $_POST[‘agent_id’] ) ) echo esc_attr($_POST[‘agent_id’]); ?>” required=”required” />
    </p>
    What do i need to do for it to be added and display properly.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 17 total)
  • Hello @soumaan,

    You have to add the new field within the array items of this file: wp-content/plugins/dokan-lite/includes/class-registration-form.php, line number 76:

            $required_fields = apply_filters( 'dokan_seller_registration_required_fields', array(
                'fname'    => __( 'Please enter your first name.', 'dokan-lite' ),
                'lname'    => __( 'Please enter your last name.', 'dokan-lite' ),
                'phone'    => __( 'Please enter your phone number.', 'dokan-lite' ),
                'shopname' => __( 'Please provide a shop name.', 'dokan-lite' ),
            ) );

    Next, you have to add the field in this file wp-content/plugins/dokan-lite/templates/global/seller-registration-form.php. While adding the code within the seller-registration-form.php file, you have to change the value within the $postdata[”] as required.

    Your field will appear in the frontend, checkout the screenshot.

    Thank you!

    Thread Starter soumaan

    (@soumaan)

    Thanks.
    I discovered this works with Dokan Theme on Localhost but does not work with my live-site.
    Is there anything else i can do?

    Hello @soumaan,

    Please use the filter from wp-content/plugins/dokan-lite/includes/class-registration.php file to override the file and use your theme’s functions.php file to keep the modified code. Otherwise you will lose the modification over update.

    Thanks!

    Thread Starter soumaan

    (@soumaan)

    Thanks, that works well.
    Is there a way i can display the information acquired from the field to show in the profile backend?

    Hello @soumaan,

    The acquired information from the custom field of the registration form, can be shown in the user section of WP admin by adding necessary custom code.

    Thanks!

    Do I need to also add to the calss-registratiion.php to sanitize too.

    $dokan_settings = array(
    ‘store_name’ => sanitize_text_field( wp_unslash( $post_data[‘shopname’] ) ),
    ‘social’ => array(),
    ‘payment’ => array(),
    ‘phone’ => sanitize_text_field( wp_unslash( $post_data[‘phone’] ) ),
    ‘taxid’ => sanitize_text_field( wp_unslash( $post_data[‘taxid’] ) ),
    ‘show_email’ => ‘no’,
    ‘location’ => ”,
    ‘find_address’ => ”,
    ‘dokan_category’ => ”,
    ‘banner’ => 0,
    );
    Thank you

    Hello @shakatime,

    Kindly follow this – https://github.com/ediamin/dokan-extends/tree/master/dokan-custom-vendor-registration-field. You can find some information to know how you can add a field.

    Hi Nazmul,

    Thanks for the code, but I would like to see if you will be interested in doing the custom work for me.

    Thanks

    Hello @shakatime did you solve the above thing..did you get the proper resolution??Plz reply…I have added the extra field in registeration form but am not finding where to save this data and how to show the field on store page

    Hi Saudpds,

    I had the same problem you are having, the data will not save, and I realized that I was spending too much time trying to make it to work with the vendor-registration plugin, but I was going no where, so, yes, I did solved the problem.

    I change to a different plugin. I was able to add the custom fields to the registration form in 5 minutes.

    Good luck

    @shakatime… Could you please tell me whats the plugin name??

    are you working on a multi vendor site?

    Yes.. I am using Dokan plugin…

    I added one field is PAN Number in seller registration form. This field is stored also in database but i want to show this field data on Vendors Profile Page.

    Hie Shakatime, which plugin are you using now? I am having exactly the same problem!

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Add new Input Field on Seller Registration Page’ is closed to new replies.