1

I'm using the uc_ddate module.

How would one hook into the checkout pane to cause it to force it to validate and make the delivery date option required?

3

Would that checkout pane still be captured by hook_alter_form()? If so you could add #required to the field there. Let me have a quick try and I'll get back to you.

EDIT: OK, this worked for me:

function tools_utilities_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'uc_cart_checkout_form') {
    // Make delivery date required
   $form['panes']['ddate']['ddate']['#required'] = true;
 }
}

Create your own module (mine is called tools_utilities in this example) and implement the above and you should be good to go :)

1
  • Thank you! That works brilliantly. I forgot it counts as a form.
    – chrisjlee
    Dec 2 '11 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.