strange behavior address input on registrationform

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
8 years 5 months ago #241909

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1

Hi,

The last week I get much orders with a strange lastname. The first section of the clients emailaddress is prefilled into the "address_lastname"? See screenshot...

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 5 months ago #241910

Hi,

It's not the first section of the clients email address. It's the first section of the user name of the customer that is used to prefill the last name field, thanks to the code:

$name = $userCMS->get('name');
				$pos = strpos($name, ' ');
				if($pos !== false) {
					$address->address_firstname = substr($name, 0, $pos);
					$name = substr($name, $pos + 1);
				}
				$address->address_lastname = $name;
in the file components/com_hikashop/views/address/view.html.php

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

  • Posts: 507
  • Thank you received: 21
  • Hikashop Business
8 years 5 months ago #241965

Hi Nicolas,

Ok, has this been changed recently, as I never had this problem before? I did change the Login/Register page to "simplified registration with password". The customer then only fills in his/her emailaddress and own password. On the next page they have to enter the address info. On this page then, the name is prefilled, but it can't be the customers lastname, as he /she didn't submit this name before, only the emailaddress. Maybe that's where this is going wrong?

Michel

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 5 months ago #242017

Hi,

It has alwasy been like that as far as I can remember.
In simplified registration, the email is used as username and the part before the @ is used as name of the user account.
So it explains why you get the first part of the email in the last name field of the address.

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

  • Posts: 52
  • Thank you received: 0
  • Hikashop Business
7 years 9 months ago #260954

Hi Nicolas,
I have a standard (Registration) type registration. I'm trying to remove the core NAME field and set it's value to be equal to the USERNAME field value.
Could you please post the required code if this is easily achievable. Thank you in advance.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #260956

Hi,

Best would be to use the "simplified registration" where the username will be use the email address.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 52
  • Thank you received: 0
  • Hikashop Business
7 years 9 months ago #261029

Hi,
I've checked this option but as I already have many registered users this is not applicable. It totally screws up the login of the registered users.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #261061

Hi,

Unfortunately, if you want to remove the core name and merge it with the username ; it will require some core hack.
Because these fields are core field in Joomla and the HikaShop registration function are handling these fields with "hard code" because they cannot change.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 52
  • Thank you received: 0
  • Hikashop Business
7 years 9 months ago #261143

Hi Jerome,
By "REMOVE" I meant hide and then set the value to be equal to the USERNAME field. I thought it could be done not so hard as the simplified registration is doing something similar.
I just want to make sure that you also meant HIDE and it requires core hack?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 9 months ago #261187

Hi,

I still don't see why the simplified registration would change anything for your existing users ?
They'll still be able to use their username to login. And you can install a small authentication plugin (free) to allow the login with their email address so that everyone can use their email address.

To me, it looks way simpler than trying to remove a field that is required. As the field is required, HikaShop checks that you've filled it. If you remove it or hide it, HikaShop will still check that you entered something and if you don't, it will display an error message. To prevent that would require modifing the function register of the file administrator/components/com_hikashop/classes/user.php to remove that check. And you can understand that we can't remove that check by default since normally you want that error message if the customer doesn't enter something in the field.

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

Time to create page: 0.083 seconds
Powered by Kunena Forum