Custom Field in Settings

This topic contains 1 reply and 2 voices, and was last updated by Sk 9 years, 11 months ago
Viewing 1 Posts - 1 through 1 (of 1 total)
Author Posts
May 19, 2014 at 1:15 am 20663
Sk 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>
May 19, 2014 at 5:29 pm 20700
Sk Sk

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 1 Posts - 1 through 1 (of 1 total)