Alright, I have done a lot of reading about this topic but I cannot seem to find this exact info to make this work for me... In checkout, there is a field for "Displayed Name", which I have learned is for the Joomla Core user field "Name" when registering an account. Therefore, I understand that in order to register an account during checkout, SOMETHING needs to be used there.
However, I do NOT want this field to be seen by customers because it is confusing and redundant. Therefore, I would like to hide the field using CSS and auto-fill it with whatever the user inputs for the "First Name" and "Last Name" fields.
I found something close, which looks to be editing this file (templates\xxxxxxxxx\html\com_virtuemart\user\edit_address_userfields.php) and it allows auto-filling the "Displayed Name" field using the "username" data:
<?php
if ($addrtype != 'ST') {
?>
<script type="text/javascript">
document.getElementById("username_field").setAttribute("onchange", "username_is_name_field()");
function username_is_name_field(){
var reg_fill_name_field = document.getElementById("username_field").value
document.getElementById("name_field").value = (reg_fill_name_field);
}
</script>
<?php } ?>
However, I really want it to auto-fill using the "first name" AND "last name" fields instead of username. Can anyone help me with this one?