You are here

function flexiform_checkout_pane_checkout_form_validate in Flexiform 7

Flexiform Checkout Pane Validate Callback.

File

./flexiform.checkout.inc, line 25
Flexiform Checkout integration.

Code

function flexiform_checkout_pane_checkout_form_validate(&$form, &$form_state, $checkout_pane, &$order) {
  $builder = $form[$checkout_pane['pane_id']]['#flexiform_builder'];
  $builder
    ->formValidate($form[$checkout_pane['pane_id']], $form_state);

  // @todo: See if we can set the base entity on the builder rather than pulling
  // it off afterwards.
  $order = $builder
    ->getFormEntity('base_entity');
  if (form_get_errors()) {
    return FALSE;
  }
  return TRUE;
}