You are here

function commerce_coupon_usage_evaluate_usage_configure in Commerce Coupon 7.2

Inline conditions configure callback: evaluate max usage for coupon.

1 string reference to 'commerce_coupon_usage_evaluate_usage_configure'
commerce_coupon_usage_inline_conditions_info in modules/usage/commerce_coupon_usage.module
Implements hook_inline_conditions_info().

File

modules/usage/commerce_coupon_usage.module, line 127

Code

function commerce_coupon_usage_evaluate_usage_configure($settings) {
  if (is_string($settings)) {
    $settings = unserialize($settings);
  }
  $form['max_usage'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum usage'),
    '#default_value' => !empty($settings['max_usage']) ? $settings['max_usage'] : '',
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
    '#required' => TRUE,
  );
  return $form;
}