You are here

function uc_discounts_discount_id_options in Ubercart Discounts (Alternative) 7.2

Option list callback for discount ids.

1 string reference to 'uc_discounts_discount_id_options'
uc_discounts_rules_condition_info in uc_discounts/uc_discounts.rules.inc
Implements hook_rules_condition_info().

File

uc_discounts/uc_discounts.rules.inc, line 102
Rules integration for uc_discounts module.

Code

function uc_discounts_discount_id_options() {
  $discounts = db_select('uc_discounts', 'ud')
    ->fields('ud')
    ->orderBy('name', 'asc')
    ->execute()
    ->fetchAll();
  foreach ($discounts as $discount) {
    $options[$discount->discount_id] = $discount->name;
  }
  return $options;
}