i always find the splitting of names problematic....
with regards to this specific situation, the interesting thing is that it looks the cc_owner is getting populated as well as validated. i suppose the easiest thing would present code such as this as the start of the before_process function:
Code:
$order->info['cc_owner'] = $_POST['cc_owner'];
$parts = explode(" ", $order->info['cc_owner']);
$lastname = array_pop($parts);
$firstname = implode(" ", $parts);
you can then use the $firstname and $lastname variables later in the function. note that firstname will contain everything but the last word in cc_owner. and last name will contain the last word.
as to why the code is the way it is, your guess is as good as mine. but clearly, it does not look correct as you have accurately pointed out.
Bookmarks