Hi,
Modifying directly a core file of HikaShop or Joomla is not what I would recommend.
There are two ways I would recommend doing it:
- you could develop a small Joomla plugin of the group "user" and implement the event onUserBeforeSave :
docs.joomla.org/Plugin/Events/User#onUserBeforeSave
That way, it works not only with HikaShop's registration form, but Joomla's and most extensions out there which need to have their own registration form. Also, since you're doing it as a plugin, you won't have to modify a core file each time you update Joomla or HikaShop, and it would work even with future versions of Joomla / HikaShop (until Joomla decides to break the plugin system but I hope it never happens)
- you could also do a view override of the registration form view. For HikaShop, you can easily find which view file you need to change :
www.hikashop.com/support/documentation/1...-display.html#layout
In it, you could add a javascript script to monitor what is being written in the username input field. Here is a tutorial on input field validation in javascript:
dev.to/dailydevtips1/vanilla-javascript-email-validation-21b3
Since you would do this as a view override, you won't have issues with updates for a while. However, this means you won't get the modifications we add in that view file in the future (for new features, or compatibility with future versions of Joomla), it's on the browser side of things, so bots or attackers can bypass the check, and it would only apply to the registration form in HikaShop, leaving the Joomla registration form page open with the same issue unless you also do an override for it.
So as you can see, I recommend the plugin approach. It's a bit more work if you're not familiar with how to create a plugin (but once you know how, it's nothing difficult), but in all other aspects, I think it's better.