I'm working on adding some custom data to the order process for a site. I've been going through the Developer's Guide and the Lead Tracker module, since it is offered as an example, and I keep seeing discrepancies between the documentation and the sample module (for instance, see here). A case of this is regarding the view op in the form builder function for hook_order_pane. According to the documentation, it is "expected to return a pane object with the attribute fields set to be an array of form elements." However, in the module, I see no field attribute at all:
function uc_lead_order_pane() {
$panes[] = array(
'id' => 'lead',
'callback' => 'uc_order_pane_lead',
'title' => t('Sales Tracking'),
'desc' => t('See how the customer found out about your site.'),
'class' => 'abs-left',
'weight' => 7,
'show' => array('view'),
);
return $panes;
}function uc_order_pane_lead($op, $arg1) {
switch ($op) {
case 'view':
if (empty($arg1->lead['source'])) {
$lead = t('None specified');
}
elseif ($arg1->lead['source'] == t('Other source')) {
$lead = $arg1->lead['other'];
}
else {
$lead = $arg1->lead['source'];
}
return t('Sales lead: @lead', array('@lead' => $lead));
}
}Another question is, how do I format the return from the form builder with multiple fields (I have 9)? I've tried a few different configurations, but I can't seem to get it right.
Thanks.





Joined: 02/20/2008