You are here

function uc_stripe_form_uc_recurring_product_feature_form_alter in Ubercart Stripe 6

Same name and namespace in other branches
  1. 7 uc_stripe.module \uc_stripe_form_uc_recurring_product_feature_form_alter()

Implements hook_form_FORM_ID_alter().

File

./uc_stripe.module, line 80
A module used for Stripe. Developed by Victor Quinn for Health for Hackers (http://www.healthforhackers.com)

Code

function uc_stripe_form_uc_recurring_product_feature_form_alter(&$form, &$form_state) {

  // Disable days and weeks as Stripe has no notion of them.
  unset($form['interval']['regular']['regular_interval_unit']['#options']['days']);
  unset($form['interval']['regular']['regular_interval_unit']['#options']['weeks']);
  $form['num_interval']['unlimited_intervals']['#disabled'] = TRUE;
  $form['num_interval']['unlimited_intervals']['#description'] = t('Note: The Stripe payment module only allows unlimited billings on products.');
  unset($form['num_interval']['number_intervals']);
  $form['fee']['fee_same_product']['#description'] = t("The product price is currently %price", array(
    '%price' => $form['fee']['product_price']['#value'],
  ));
  $form['interval']['regular']['regular_interval_value']['#options'] = array(
    1,
  );

  // Call our validation function.
  $form['#validate'][] = "uc_stripe_product_feature_validate";
}