How to add phone number fields on OJS 3 registration form?

Some of the publishers of the journal sometimes need author client numbers so they can contact the author to notify the information about the submission process. However, in OJS this field is not available by default. It needs to make some modifications on the core ojs and theme file to achieve this

In this case, we will add phone as the additional field on the registration form.

Notice :
This step required some core ojs modification. Experienced personal are required to finish this step. Before continuing please make sure you have backup your OJS. By taking this step make sure you repeat the same step when you have to upgrade your ojs version. This only works on OJS 3.

Here how to do it : 

Add the phone number field when app execute the registration process

1. Open this file on your OJS installation :



2. Find the function named as: readInputData() On those function you should add the new field as in this example we add new phone

 3. On the same file, find the function named as: execute()
    Add this line (please change based as the new custom field you have added before) : 
    $user->setPhone($this->getData(‘phone’));
    So the code on the execute()  would be :

 

Add the custom field on the registration form template :

  1. Find the template for your registration form. If you are using default theme it can be found on :

    However, if you are using our template either Academic Pro or Unify you can find the registration Form file here :



  2. Add new form field on the file :
<div class="phone">
    <label>
        <span class="label">
            {translate key="user.phone"}
            <span class="required">*</span>
            <span class="pkp_screen_reader">
               {translate key="common.required"}
            </span>
        </span>
        <input type="text" name="phone" id="phone" value="{$phone|escape}" maxlength="40" required>
    </label>
</div>

3. Test the registration with any new user data. 

4.  After you have succeeded the registration.
You should make sure that the new phone data is saved on the database by accessing the user profile and check whether this field is filled with phone number data. 

 

That it.

Reference : 

  1. https://forum.pkp.sfu.ca/t/add-new-field-to-registration-form/34284/9 
  2. http://acahya.web.id/menambahkan-no-handphon-di-register-form-ojs/

Leave a Comment

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

Open Journal Theme

Professional OJS products, services and support

Need More Services  or Question?

Openjournaltheme.com started from 2018 by passionate team that focused to provide affordable OJS product and services. Our team initiate this company to help many publisher to be more focus on their content research rather than tackled by many technical OJS issues.