You are here

function uc_payment_method_cod_form in Ubercart 7.3

Same name and namespace in other branches
  1. 5 payment/uc_payment_pack/uc_payment_pack.module \uc_payment_method_cod_form()
  2. 6.2 payment/uc_payment_pack/uc_payment_pack.module \uc_payment_method_cod_form()

Collect additional information for the "Cash on Delivery" payment method.

1 call to uc_payment_method_cod_form()
uc_payment_method_cod in payment/uc_payment_pack/uc_payment_pack.module
Payment method callback for the "Cash on Delivery" payment method.

File

payment/uc_payment_pack/uc_payment_pack.module, line 245
Provides the Check/Money Order, COD, and "Other" payment methods.

Code

function uc_payment_method_cod_form($form, &$form_state, $order) {
  $month = !empty($order->payment_details['delivery_month']) ? $order->payment_details['delivery_month'] : format_date(REQUEST_TIME, 'custom', 'n');
  $day = !empty($order->payment_details['delivery_day']) ? $order->payment_details['delivery_day'] : format_date(REQUEST_TIME, 'custom', 'j');
  $year = !empty($order->payment_details['delivery_year']) ? $order->payment_details['delivery_year'] : format_date(REQUEST_TIME, 'custom', 'Y');
  $form['description'] = array(
    '#markup' => '<div>' . t('Enter a desired delivery date:') . '</div>',
  );
  $form['delivery_month'] = uc_select_month(NULL, $month);
  $form['delivery_day'] = uc_select_day(NULL, $day);
  $form['delivery_year'] = uc_select_year(NULL, $year, format_date(REQUEST_TIME, 'custom', 'Y'), format_date(REQUEST_TIME, 'custom', 'Y') + 1);
  return $form;
}