How to add a field to review page?
How could i add a custom field to review page if i dont want it to be part of order data?
I would like to add a checkbox to review page and store value of it for a user related data. I am using the Site Disclaimer module and i would do function of it on review page so i need a simple checkbox without using pane.
What i tryed is the following:
<?php
/**
* Implements hook_form_FORM_ID_alter().
*/
function MYMODULE_form_commerce_checkout_form_review_alter(&$form, &$form_state) {
$form['I_agree'] = array(
'#type' => 'checkbox',
'#title' => $checkbox_label,
'#required' => TRUE,
// The following adds "required" validation to the checkbox (patches core missing functionality as of D6.16)
'#element_validate' => array('_site_disclaimer_validate_checkbox'),
'#return_value' => variable_get('site_disclaimer_version', 1),
'#weight' => 0,
);
}
?>
I tryed to add a required checkbox with review form alter but when the checkbox is not filled and the form is submitted there wont be any error message(cos it is a required field.). I have noticed one interesting thing. Somebody suggested me to use pane for this. I tryed his code with an example required textfield. Both of them were(checkbox as above and the textfield in pane) on form. When none of them were filled and i have hit the submit button all fields were validated and there were error messages, but without pane nothing happenes at all.
So how could i add a custom field to review page without having to do a pane version? And where could i add my submit function to checkbox? Thx in advance!