Adding extra field on the vendor registration form in Dokan

I was getting a high request to write a blog to show how you can easily add an extra field on the vendor registration form and show that data on the user profile. It is really necessary for some marketplace to register vendor with their TAX ID or GST Number. Dokan does not provide any default field for that kind of data but you can easily add your own field.

How can I add?

You need a child-theme before doing this process. If you have installed a child theme already then you can override the seller registration form through it.

Please create a folder called dokan into your child-theme and then create another folder into dokan folder called global. Now, copy the seller-registration-form.php file from your wp-content/plugins/dokan-lite/templates/global folder and paste it to your child-theme like below –

Overriding template

You can read full details on how to override the template here.

Now, from your child-theme open the seller-registration-form.php file and add the extra field on your desire position like below –

Adding input field on registration form file

You can use this code if you want to just copy and paste (Field for GST Number) –

 <p class="form-row form-group form-row-wide">
        <label for="shop-phone"><?php esc_html_e( 'GST Number', 'dokan-custom-codes' ); ?><span class="required">*</span></label>
        <input type="text" class="input-text form-control" name="gst_id" id="gst_id" value="<?php if ( ! empty( $postdata['gst_id'] ) ) echo esc_attr($postdata['gst_id']); ?>" required="required" />

After adding the input field you will be able to see the registration field on the vendor registration form-

Field added on registration form

Now, you have to save the field data and need to show on user profile.

How to save field value and show on backend user profile?

Just open your functions.php file and paste the below code –

If you want to change the field name or meta key then you have to change the meta key or field name accordingly on every place. On this code, I have used the meta key for the field as dokan_custom_gst_id and use the field id as gst_id

After saving the above code, you will be able to use vendor GST Number on his/her user profile –

By following this post you will be able to add multiple fields with different meta key.

You can also follow this video to show the above steps –

12 thoughts on “Adding extra field on the vendor registration form in Dokan

  1. Hi Nayem this is fantastic.
    How can the GST field be made visible on the vendor store page on the frontend of vendor settings

    1. I am sorry, it was not wrong. I added the field on the registration form of my-account but the file location you have provided is for the separate registration form.

  2. Thanks for this information. I was looking for this.
    But this process is same in all theme or we have to install dokan theme only?

    And is it important to use both child and parents theme?

  3. How can I get the phone number of a store so that the buyer can send a message with a button? Im trying with shortcode and snippet, but i cant do it.

  4. How can i add brand dropdown list in vendor product upload form? i want my vendor can select brand of their product from dropdown field.

  5. Hi, Nazmul Hassan
    I want to add a dropdown selector to the single product page as a required field which vendors can input choices for the customer to select. Many of my vendors have several pick-up points, one of which would be the customer’s preference. No shipping, local pick-up only. I don’t want it as a product variation and only want vendors to create a single product. The selected location would have to be included int the customers order details. Thanks for any ideas, Peter.

Leave a Reply

Your email address will not be published. Required fields are marked *