22-Nov-2020 12:00 AM
10324
In open Journal system (OJS) version 3.x, here we are explaining how add phone number input in registration form
1. Change in RegistrationForm.inc.php
public_html/lib/pkp/classes/user/form/RegistrationForm.inc.php
Code Sample: at line 70
{*Zuber*}
<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>
{*Zuber*}
2. Change in registrationForm.tpl
public_html/lib/pkp/templates/frontend/components/registrationForm.tpl
Code Sample:
Find function readInputData() at 128 then find readUserVars array
add variable at line 138 : 'phone',
Find function execute() at 208 then find $user->setEmail($this->getData('email'));
add line after/before at line 228 : $user->setPhone($this->getData('phone'));