Hi
I need to add a required pane in the cart panes.
I've managed to add a pane using hook_cart_pane but even if I put elements as #required => TRUE using FAPI, the validation is ignored, I think that this is because the form is different for each pane.
I have something like this:
<?php
function my_module_cart_pane($items) {
$panes[] = array(
'id' => 'my_module_cart_pane',
'title' => t('Title of pane'),
'desc' => t("Description of pane"),
'weight' => 6,
'enabled' => TRUE,
'body' => !is_null($items) ? drupal_get_form('my_module_cart_form', $items) : '',
);
return $panes;
}
?>And the callback form is like this:
<?php
function my_module_cart_form($items) {
$form['field'] = array(
'#type' => 'checkboxes',
'#title' => t('Title'),
'#options' => array(t('Text of checkbox')),
'#required' => TRUE,
);
return
$form;
}
?>The required * is shown, but is not validated.
I've used this same code in the hook_checkout_pane and the validation DOES work, how can I achieve the same for hook_cart_pane?
Thanks!


