Hi,
Im using VM v.2.0.26d
It seems that when a customer creates a new profile via the Virtuemart registration form, or when a new customer creates an order, then the user“s email is stored as Joomla user "Full Name" field (not username).
Instead I would like it to store VM first name + last name as Joomla "Full Name".
How do I accomplish this?
Has anyone had the same problem?
And does anyone know which file I should look into in order to change the VM registration to save the Joomla user info as explained?
This is not done by vm. You can accomplish that with a js.
If input for displayed name is empty, fill it with vm firstname + lastname
Hi Milbo,
Thanks for the answer.
I found this script on the registration form page:
<script type="text/javascript">
document.getElementById("email_field").setAttribute("onchange", "mail_is_user()");
function mail_is_user(){
var reg_email = document.getElementById("email_field").value
document.getElementById("name_field").value = (reg_email);
document.getElementById("username_field").value = (reg_email);
}
</script>
So I guess I could just modify this script to instead save the "name_field" as First Name + Last Name
Furthermore, I found out that the code was located in one of the template“s override folders, so this problem is specific for my template only.
Just to wrap it up, I finally got it working by changing the javascript to this:
<script type="text/javascript">
document.getElementById("email_field").setAttribute("onchange", "mail_is_user()");
function mail_is_user(){
var reg_email = document.getElementById("email_field").value;
document.getElementById("username_field").value = (reg_email);
}
document.getElementById("first_name_field").setAttribute("onchange", "joomla_name_is_vmname()");
document.getElementById("last_name_field").setAttribute("onchange", "joomla_name_is_vmname()");
function joomla_name_is_vmname(){
var first_name = document.getElementById("first_name_field").value;
var last_name = document.getElementById("last_name_field").value;
document.getElementById("name_field").value = (first_name + ' ' + last_name);
}
</script>
Nice snippet. We could add it to the core layout. We could also do it in the model, but that would need an extra option. The js solution is easy to remove and to adjust.
Yes, indeed.
It should be fairly easy to make some kind of VM admin implementation of this snippet.
Maybe the shopowner could then have some options to choose exactly how he want the registration form to save the VM user data in the core Joomla user tables.
The problem is actually that the loginname is part of the password. It is a bit similar to the public key. So actually there should be at least a random alphanumeric in it.