// If there's no 'first_name' in the profile then overwrite the names from
// the billing fields (if they are set)
- // @todo This logic is flawed, at least check each field??
+ // @todo Reconcile with the contribution method formatParamsForPaymentProcessor
+ // rather than adding different logic to check when to keep the billing
+ // fields. There might be a difference in handling guest/multiple
+ // participants though.
if (is_array($fields)) {
if (!array_key_exists('first_name', $fields)) {
$nameFields = array('first_name', 'middle_name', 'last_name');
}
// Add the billing names to the billing address, if a billing name is set
- if ($form->_values['event']['is_monetary'] && !empty($params['billing_first_name'])) {
+ if (!empty($params['billing_first_name'])) {
$params["address_name-{$form->_bltID}"] = CRM_Utils_Array::value('billing_first_name', $params) . ' ' . CRM_Utils_Array::value('billing_middle_name', $params) . ' ' . CRM_Utils_Array::value('billing_last_name', $params);
$fields["address_name-{$form->_bltID}"] = 1;
}