[Skip to main content](#vessel-content)

#   Help replacing username in checkout registration

##

- **[stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile")**
- [![stratacorps's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33546-stratacorps "View stratacorps's Profile") Topic Author
- [ Offline](/forum/user/33546-stratacorps)

Less More

- Posts: 116
- Thank you received: 7
-

5 years 8 months ago -  5 years 8 months ago [\#330679](#330679) by [stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile")  *[Help replacing username in checkout registration](/forum/27-checkout/902155-help-replacing-username-in-checkout-registration#330679 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.25 -- PHP version -- : 7.4  I am modifying sub&#95;block&#95;login&#95;registration to replace the username field. I am trying to fill the field value with the Email address (we already use Email for login, but I realize the J! requires a unique username, so this seems to be the safest method other than possible creating a random username based on the email address like the J! Name field does in Hikashop).  Either way, I need help with the best way to manipulate the username field after the user enters the Email address on the form.  If there is a better way to omit the username field from the process, I couldn't find it. If we use Simplified Registration with/without password, the Name field isn't available, and the Name field gets populated with the left-of-@ portion of the Email address provided.  Thanks!  EDIT: javascript! ... maybe I over complicated things a bit, so I've hidden the label/field and used javascript/onchange. But is this where/how I should be doing it? It would be nice to have an option to either randomize this, or set to email, etc. and hide since we can already do something similar with the simplified registration option.")* was created by *[stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile")*

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.25
-- PHP version -- : 7.4

I am modifying sub_block_login_registration to replace the username field. I am trying to fill the field value with the Email address (we already use Email for login, but I realize the J! requires a unique username, so this seems to be the safest method other than possible creating a random username based on the email address like the J! Name field does in Hikashop).

Either way, I need help with the best way to manipulate the username field after the user enters the Email address on the form.

If there is a better way to omit the username field from the process, I couldn't find it. If we use Simplified Registration with/without password, the Name field isn't available, and the Name field gets populated with the left-of-@ portion of the Email address provided.

Thanks!

EDIT: javascript! ... maybe I over complicated things a bit, so I've hidden the label/field and used javascript/onchange. But is this where/how I should be doing it? It would be nice to have an option to either randomize this, or set to email, etc. and hide since we can already do something similar with the simplified registration option.

Last edit: 5 years 8 months ago by [stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMjE1NS1oZWxwLXJlcGxhY2luZy11c2VybmFtZS1pbi1jaGVja291dC1yZWdpc3RyYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

5 years 8 months ago [\#330698](#330698) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Help replacing username in checkout registration](/forum/27-checkout/902155-help-replacing-username-in-checkout-registration#330698 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.25 -- PHP version -- : 7.4  I am modifying sub&#95;block&#95;login&#95;registration to replace the username field. I am trying to fill the field value with the Email address (we already use Email for login, but I realize the J! requires a unique username, so this seems to be the safest method other than possible creating a random username based on the email address like the J! Name field does in Hikashop).  Either way, I need help with the best way to manipulate the username field after the user enters the Email address on the form.  If there is a better way to omit the username field from the process, I couldn't find it. If we use Simplified Registration with/without password, the Name field isn't available, and the Name field gets populated with the left-of-@ portion of the Email address provided.  Thanks!  EDIT: javascript! ... maybe I over complicated things a bit, so I've hidden the label/field and used javascript/onchange. But is this where/how I should be doing it? It would be nice to have an option to either randomize this, or set to email, etc. and hide since we can already do something similar with the simplified registration option.")*

Hi,

You have two ways to go about it:
- like you did, you go with the normal registration, hide the username field with CSS and add a bit of javascript with an onchange attribute on the email input field in sub_block_login_registration to automatically set the value of the username field with the value entered in the email email.
- you use the 'Simplified Registration with/without password' mode and modify sub_block_login_registration to display the name field. That way, it will be taken into account instead of generating it from the email field. That's simplier as it doesn't require javascript or writting any code, just removing the PHP check around the name input field.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMjE1NS1oZWxwLXJlcGxhY2luZy11c2VybmFtZS1pbi1jaGVja291dC1yZWdpc3RyYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile")**
- [![stratacorps's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33546-stratacorps "View stratacorps's Profile") Topic Author
- [ Offline](/forum/user/33546-stratacorps)

Less More

- Posts: 116
- Thank you received: 7
-

5 years 8 months ago [\#330742](#330742) by [stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile")  Replied by *[stratacorps](/forum/user/33546-stratacorps "View stratacorps's Profile")* on topic *[Help replacing username in checkout registration](/forum/27-checkout/902155-help-replacing-username-in-checkout-registration#330742 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.25 -- PHP version -- : 7.4  I am modifying sub&#95;block&#95;login&#95;registration to replace the username field. I am trying to fill the field value with the Email address (we already use Email for login, but I realize the J! requires a unique username, so this seems to be the safest method other than possible creating a random username based on the email address like the J! Name field does in Hikashop).  Either way, I need help with the best way to manipulate the username field after the user enters the Email address on the form.  If there is a better way to omit the username field from the process, I couldn't find it. If we use Simplified Registration with/without password, the Name field isn't available, and the Name field gets populated with the left-of-@ portion of the Email address provided.  Thanks!  EDIT: javascript! ... maybe I over complicated things a bit, so I've hidden the label/field and used javascript/onchange. But is this where/how I should be doing it? It would be nice to have an option to either randomize this, or set to email, etc. and hide since we can already do something similar with the simplified registration option.")*

Thank you so much...I did the first one in testing, but the 2nd choice is better. I'm glad I asked.

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMjE1NS1oZWxwLXJlcGxhY2luZy11c2VybmFtZS1pbi1jaGVja291dC1yZWdpc3RyYXRpb24/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.071 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
