You are here

function uc_recurring_product_form_uc_order_view_update_form_alter in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 modules/uc_recurring_product/uc_recurring_product.module \uc_recurring_product_form_uc_order_view_update_form_alter()

Implements hook_form_FORM-ID_alter().

See also

uc_order_view_update_form()

File

modules/uc_recurring_product/uc_recurring_product.module, line 421
Add recurring payments/fees to a product. This is imlpemented through Ubercarts product features.

Code

function uc_recurring_product_form_uc_order_view_update_form_alter(&$form, $form_state) {

  // Load the order object based on the form value for the order ID.
  $order = uc_order_load($form['order_id']['#value']);

  // Look for recurring fees on this order.
  $products = uc_recurring_product_get_recurring_products_in_order($order);

  // If they haven't been added, display the checkbox to make it so.
  if (count($products)) {
    $form['process_fees'] = array(
      '#type' => 'checkbox',
      '#title' => t('Process the @count recurring fees associated with products on this order.', array(
        '@count' => count($products),
      )),
      '#description' => t('This action will not be available after any fees are successfully processed.<br /><b>Important:</b> You must verify that the credit card information is correct before processing the fees!'),
      '#weight' => 5,
    );
    $form['#submit'][] = 'uc_recurring_product_order_view_update_form_submit';
  }
}