You are here

function uc_order_pane_coupon in Ubercart Discount Coupons 7.3

Coupon order pane callback.

See also

uc_quote_order_pane_quotes_submit()

uc_quote_apply_quote_to_order()

1 string reference to 'uc_order_pane_coupon'
uc_coupon_uc_order_pane in ./uc_coupon.module
Implements hook_uc_order_pane().

File

./uc_coupon.module, line 2237
Provides discount codes and gift certificates for Ubercart.

Code

function uc_order_pane_coupon($op, $order, &$form = NULL, &$form_state = NULL) {
  switch ($op) {
    case 'edit-form':
      $submit = array(
        '#limit_validation_errors' => array(
          array(
            'coupon',
          ),
        ),
        '#submit' => array(
          'uc_coupon_order_submit',
        ),
      );
      $form['coupon'] = uc_coupon_form(array(), $form_state, 'order', $submit);
      $form['#uc_coupon_form_context'] = 'order';
      $form['coupon']['#theme'] = 'uc_coupon_form';
      $form['coupon']['#tree'] = TRUE;
      break;
    case 'edit-theme':
      return drupal_render($form['coupon']);
  }
}