You are here

function uc_recurring_order_form_uc_recurring_admin_edit_form_alter in UC Recurring Payments and Subscriptions 7.2

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

Alter the Edit screen to show the products in the order.

File

modules/uc_recurring_order/uc_recurring_order.module, line 359
Provides a way to duplicate entire orders.

Code

function uc_recurring_order_form_uc_recurring_admin_edit_form_alter(&$form, $form_state) {
  $rfid = $form['rfid']['#value'];
  $fee = uc_recurring_fee_user_load($rfid);
  if (!empty($fee->data['uc_recurring_order'])) {
    foreach ($fee->data['uc_recurring_order']['products'] as $product) {
      $row = array(
        'title' => $product->title,
        'qty' => $product->qty,
        'price' => $product->price,
      );
      $rows[] = $row;
    }
    $form['products'] = array(
      '#type' => 'fieldset',
      '#title' => t('Products'),
      '#description' => theme('table', array(
        'header' => array(
          'Product',
          'Quantity',
          'Price',
        ),
        'rows' => $rows,
      )),
      '#weight' => -10,
    );
  }
}