Hi,
If you look at the example I gave you, the user is not yet logged in and the firstname and lastname fields are visible.
So this means that in this case it is impossible to get the name of the user account to prefill the firstname and lastname fields of the form, since that information is not yet known to your server. It's a matter of order of the events.
That's what I was trying to explain with my example.
In this case, the only solution would be to do it with javascript code on the fly on the page.
This is still possible to add with a view override.
And if the user is logged in and you access the checkout, then the user will be logged in, and you can indeed use the information in PHP to prefill the fields, also with a view override. But normally, when the user accesses the checkout after adding a product to the cart, he is not yet logged in. And thus, you can do this.
Also, another point I didn't brought up in my previous message is that the name of the user in Joomla is in one field. And the firstname and lastname in the address are two different fields. Splitting the name from Joomla in two can be hazardous. What happens if the user enters only one word in there ? What if he enters 3 words ? What if his name is in Chinese characters without any spaces between the firstname and the lastname ? What about the order of the words ? In some countries the firstname is first when writting the full name, and in some others, the lastname comes first. Doing it the other way, by combining the firstname and lastname from the address to generate name of the user account during its creation avoids all these pitfalls. And best of all, it doesn't require any coding on your end since it's just an option to change.
Technically, you could have a mixed solution of both PHP and javascript in order to handle all this properly. If you're a developer, it's not difficult to do. You'll just spend a few hours on it or more. It's not just one or two lines of code. So since you asked about the code to do it in your initial message, I assumed you were not a developer and thus I directed you to the simplified registration option.