• Resolved alanhiper

    (@alanhiper)


    Hello, i’m trying to add some custom fields at the student registration page like fone and adress, can i do that?

    • This topic was modified 4 years, 10 months ago by alanhiper.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi there,

    Thanks a lot for using Tutor LMS and contacting us. To add some custom fields at the student registration page, you will need to override the registration.php file from this location: /wp-content/plugins/tutor/templates/dashboard/

    Please check our template overriding documentation here: https://www.themeum.com/docs/override-tutor-templates/

    Regards,
    Mehedi

    Thread Starter alanhiper

    (@alanhiper)

    Hello! Thanks for your answer!
    I’m able to add the field but will he be saved on the database of WordPress after the student do the subscribe?

    i mean, i can add him on the front, but i’ll need the data for consult later.

    Hello @alanhiper,

    If you have created a child theme, copied the templates folder from the parent plugin, renamed it as Tutor, maintained the folder and file structure of the parent plugin then everything should be up and running along with your modification.

    Please follow the instructions given in the following link accordingly
    https://www.themeum.com/docs/override-tutor-templates/

    Good luck.

    Hello

    I have added some custom fields by coping the dashboard files into child theme tutor folder as described above, but when I enter some values into these fields they are not saving in database. How to do this ?

    Hello, One more question I have. How to add an external link in dashboard menu bar i.e. the page which I want to link in menu is not a page that is other plugin page so I only have link of that not not page physically.

    Hi, I’m having the same problem, I add the fields but they don’t update in the database and I can’t see them in the profile either.

    Hello @arielesponda100491 and @bhavna28,

    After overriding the template files, you will need to create a relation with the data for saving the data. On the user registration action hook, you have to save data to the usermeta table.

    Here is a simple code to require verification phone_no field and save it to the database.

    add_filter('tutor_student_registration_required_fields', 'required_phone_no_callback');
    if ( ! function_exists('required_phone_no_callback')){
        function required_phone_no_callback($atts){
            $atts['phone_no'] = 'Phone Number field is required';
            return $atts;
        }
    }
    add_action('user_register', 'add_phone_after_user_register');
    add_action('profile_update', 'add_phone_after_user_register');
    if ( ! function_exists('add_phone_after_user_register')) {
        function add_phone_after_user_register($user_id){
            if ( ! empty($_POST['phone_no'])) {
                $phone_number = sanitize_text_field($_POST['phone_no']);
                update_user_meta($user_id, '_phone_number', $phone_number);
            }
        }
    }

    I hope it will help you. FYI, you need to replace phone_no with your field name.

    Regards,
    Mehedi

    Hello @alanhiper @bhavna28 @arielesponda100491

    We have shared a sample code to help you understand how to add a new field in the registration form. If you have any questions, please feel free to ask here or send us an email.

    https://docs.themeum.com/tutor-lms/developers/custom-field-on-registration/

    same here no update DB

    @lmilani,

    I have updated the documentation just now with more details. Please check the documentation link I have shared above again.

    How to add custom field to login popup while enrolling to the course?

    • This reply was modified 4 years, 5 months ago by shravan592.

    I just want to know path of login pop up, so that I can make some changes

    Hello @shravan592

    You can add custom field to login popup easily by overriding the login file. Go to Plugins/tutor/templates/login.php and override this file into your child theme. Please see this documentation for overriding tutor templates: https://docs.themeum.com/tutor-lms/developers/override-templates/

    hello, over than adding custom fields you should provide a way so the form is GDPR complain for Europe and to be correct the form should include a mandatory checkbox where the user does accept the privacy and cookies policy. That way the form is usable also in europe, otherwise there could be some problems…

    There is a way to hook the TUTOR/STUDENT signup with a different register form.

    I would like to use the THEME proper registration form insted the Tutor ones.

    Actually i give the right “user role” but still i dont write the user on the proper TUTOR database.

    @mehedih With your code can i also update some existing fields to write in the Tutor database?

    Thank you for the helps!

    • This reply was modified 3 years, 11 months ago by marcoqwerty. Reason: more detail
    • This reply was modified 3 years, 11 months ago by marcoqwerty.
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How to add custom form fields at student registration?’ is closed to new replies.