Registration/Login form customisation

  • Posts: 112
  • Thank you received: 0
13 years 6 months ago #17192

Hi Support!

I need to customize registration and login forms as follows:

On Login form: Email address & Password fields;
On REgistration form: Title, First name, Last name, Post code, Email Password, Confirm Password fields.

That's all! I don't need any other fields. I know how to turn on and off the hikashop address fields. But how can I change the login form to use email field instead of username field?

What configuration do I need to do for this? Is this part of Joomla config? Or do I need to buy hikashop commercial version? If hikashop commercial version will it allow me to customize the Login form fields?

I am using hikashop 1.5 free edition.

Thank you!

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 6 months ago #17202

Hi,

I don't see a email field on your registration form. You probably forgot it.

In the commercial edition, what you can do is to change the "registration" option to "simplified registration". That will remove the password fields and the username field from the registration form so that you only have left the email field (and the address fields).
Then, when the system registers the user, it will generate a random password automatically for the user and use his email as username and send him an email with that information.
That way, it's less hassle for the user.

Would that be ok ?

If you really want the password fields and the email field but not the username field, you would have to change the code of the file registration of the view user in order to hide the username field and automatically populate it with the email entered by the user when the user finishes to enter his email.

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 0
13 years 6 months ago #17217

Thank you for super quick reply!

Oh, I just missed comma between Email and Password :-)

Unfortunately, the first option is not suitable, as I'd like users to select password themselves.

Could you give me a bit more details as to where in the registration file I would handle population of username with the email entered by the user? As far as I can see the registration file is just a layout of the registration form. I think I need the code which saves the data where I would manipulate the two fields?

Because I already have an account, I also noticed that in the registration form the email field gets pre-populated with the username, but the actual username field is blank :blink: Any suggestions?

Last edit: 13 years 6 months ago by lrazov.

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 6 months ago #17220

You can just replace the line:
<input type="text" id="register_email" name="data[register]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" /> * by: <input type="text" id="register_email" name="data[register][email]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" onchange="document.getElementById('register_username').value = this.value"/> * And change the line: <tr class="hikashop_registration_username_line"> to: <tr class="hikashop_registration_username_line" style="display:none;"> That will remove the username field and set it to the email address automatically.[email]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" /> *
by:

<input type="text" id="register_email" name="data[register]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" onchange="document.getElementById('register_username').value = this.value"/> * And change the line: <tr class="hikashop_registration_username_line"> to: <tr class="hikashop_registration_username_line" style="display:none;"> That will remove the username field and set it to the email address automatically.[email]" value="<?php echo $this->escape($this->mainUser->get( 'email' ));?>" class="inputbox required validate-email" maxlength="100" onchange="document.getElementById('register_username').value = this.value"/> *

And change the line:
<tr class="hikashop_registration_username_line">
to:
<tr class="hikashop_registration_username_line" style="display:none;">

That will remove the username field and set it to the email address automatically.

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 0
13 years 6 months ago #17221

Excellent! Thanks a lot!

I will try that out and report back.

Could you also have a look as to why in the registration form the email field gets pre-populated with the username, but the actual username field is blank. Any suggestions?

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
13 years 6 months ago #17223

That's your browser which prefills the input field. Nothing we can do on our end.

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 0
13 years 6 months ago #17237

The code you provided worked like charm!

Re browser re-filling the input field, I guess so, however I wonder why it refills the email field, not the username one? I suppose it's not important for me anymore since I've hidden the username field anyway :)

Thank you for the wonderful support! :)

Please Log in or Create an account to join the conversation.

  • Posts: 25
  • Thank you received: 0
11 years 1 month ago #130319

hi nicholas
this post is about 2 years ago. i tried this code but nothing seems work . will u please help me writing the code for latest hikashop. thanks

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #131024

Hi,

Just for clarification, what do you need to do ?
If you want to manage the custom fields, you can enable/disable them in Display > Custom fields menu of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 25
  • Thank you received: 0
11 years 1 month ago #131069

oh this feature is for business edition .. i just misunderstood

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum