You are here

function uc_paypal_ec_review_form in Ubercart 7.3

Same name and namespace in other branches
  1. 5 payment/uc_paypal/uc_paypal.module \uc_paypal_ec_review_form()
  2. 6.2 payment/uc_paypal/uc_paypal.pages.inc \uc_paypal_ec_review_form()

Returns the form for the custom Review Payment screen for Express Checkout.

1 string reference to 'uc_paypal_ec_review_form'
uc_paypal_ec_review in payment/uc_paypal/uc_paypal.pages.inc
Handles the review page for Express Checkout Shortcut Flow.

File

payment/uc_paypal/uc_paypal.pages.inc, line 272
Paypal administration menu items.

Code

function uc_paypal_ec_review_form($form, &$form_state, $order) {
  if (module_exists('uc_quote') && variable_get('uc_paypal_ec_review_shipping', TRUE) && uc_order_is_shippable($order)) {
    uc_checkout_pane_quotes('prepare', $order, NULL);
    $order->line_items = uc_order_load_line_items($order);
    uc_order_save($order);
    $result = uc_checkout_pane_quotes('view', $order, NULL);
    $form['panes']['quotes'] = array(
      '#type' => 'fieldset',
      '#title' => t('Shipping cost'),
      '#collapsible' => FALSE,
    );
    $form['panes']['quotes'] += $result['contents'];
    unset($form['panes']['quotes']['quote_button']);
    $form['shippable'] = array(
      '#type' => 'value',
      '#value' => 'true',
    );
  }
  if (variable_get('uc_paypal_ec_review_company', TRUE)) {
    $form['delivery_company'] = array(
      '#type' => 'textfield',
      '#title' => uc_get_field_name('company'),
      '#description' => uc_order_is_shippable($order) ? t('Leave blank if shipping to a residence.') : '',
      '#default_value' => $order->delivery_company,
    );
  }
  if (variable_get('uc_paypal_ec_review_phone', TRUE)) {
    $form['delivery_phone'] = array(
      '#type' => 'textfield',
      '#title' => t('Contact phone number'),
      '#default_value' => $order->delivery_phone,
      '#size' => 24,
    );
  }
  if (variable_get('uc_paypal_ec_review_comment', TRUE)) {
    $form['order_comments'] = array(
      '#type' => 'textarea',
      '#title' => t('Order comments'),
      '#description' => t('Special instructions or notes regarding your order.'),
    );
  }
  if (empty($form)) {
    drupal_goto('cart/echeckout/submit');
  }
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Continue checkout'),
  );
  return $form;
}