Zen Cart Logo
Forums / Bug Reports / [Done v1.5.2] function email_collect_extra_info, closing table tag in wrong place

[Done v1.5.2] function email_collect_extra_info, closing table tag in wrong place

Locked

Views: 972

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
18 Dec 2013, 7:32 AM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

[Done v1.5.2] function email_collect_extra_info, closing table tag in wrong place

I see 1.5.2 now supports the use of additional fields in the extra info section (something I use), despite not yet being used by any other vanilla code, as far as I can see.

'<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>' . '</table>';

foreach($moreinfo as $key => $val) {
$extra_info['TEXT'] .= $key . ': ' . $val . "\n";
$extra_info['HTML'] .= '<tr><td class="extra-info-bold">' . $key . '</td><td>' . $val . '</td></tr>';
}
return $extra_info;  }

However the closing table tag should now be moved to encompass the optional fields.

I suggest:

'<tr><td class="extra-info-bold">' . OFFICE_DATE_TIME . '</td><td>' . date('D M j Y G:i:s T') . '</td></tr>' ;

foreach($moreinfo as $key => $val) {
$extra_info['TEXT'] .= $key . ': ' . $val . "\n";
$extra_info['HTML'] .= '<tr><td class="extra-info-bold">' . $key . '</td><td>' . $val . '</td></tr>';
}
$extra_info['TEXT'] .= "\n";
$extra_info['HTML'] .= '</table>';
return $extra_info;
}

For the interest of anyone wishing to use this new functionality, the format of the array to be passed in the email_collect_extra_info function call would be something like this:

$extra_fields = array(
EMAIL_FORM_HONEYPOT => $honeypot_field,
EMAIL_FORM_FILL_TIME => $form_fill_time
);