Home Forums Theme Support Dokan Custom Field in Settings

This topic is: resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Sk 5 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20663

    Marita
    Member
    Post count: 7

    I know this may be out of the scope of the support forum but if anyone could help it would be awesome! And it might help other people too down the line.

    I added a new field to the registration form which works great using this code below – which then i can display this field result anywhere on the website.

     <p class="form-row form-group form-row-wide">
                <label for="other-store"><?php _e( 'Link to Other Store ie. Esty', 'dokan' ); ?> </label>
                <input type="text" class="input-text form-control" name="otherstore" id="other-store" value="<?php if ( ! empty( $_POST['otherstore'] ) ) echo esc_attr($_POST['otherstore']); ?>" />
            </p>

    IS there any way to add this field in the Dashboard -> Settings vendor dashboard? (classes/template-settings.php)

    I tried duplicating this code from classes/tempalte-settings.php) and changing all the phone to “other_store” to no avail.

                    <div class="form-group">
                        <label class="col-md-3 control-label" for="setting_phone"><?php _e( 'Phone No', 'dokan' ); ?></label>
                        <div class="col-md-5">
                            <input id="setting_phone" value="<?php echo $phone; ?>" name="setting_phone" placeholder="+123456.." class="form-control input-md" type="text">
                        </div>
                    </div>
    #20700

    Sk
    Moderator
    Post count: 371

    Hello Marita,

    you could add field in setting form like the way you do. just change input fields attributes like ( name, value, placeholder ).

    Don't forget to add the field value to the array $dokan_settings for example use 'otherstore' => $_POST['setting_otherstore'], for otherstore field if the input field name is setting_otherstore

    and check if it's empty. for this you could use the following code for the field

    $otherstore= isset( $profile_info['otherstore'] ) ? esc_attr( $profile_info['otherstore'] ) : '';

    Thank you.

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

The topic ‘Custom Field in Settings’ is closed to new replies.