function uc_discounts_condition_discount_applied_form in Ubercart Discounts (Alternative) 7.2
Same name and namespace in other branches
- 6.2 uc_discounts/uc_discounts.ca.inc \uc_discounts_condition_discount_applied_form()
See also
uc_discounts_condition_discount_applied()
File
- uc_discounts/
uc_discounts.ca.inc, line 62 - Conditional action functions for uc_discounts module.
Code
function uc_discounts_condition_discount_applied_form($form_state, $settings = array()) {
$form = array();
$result = db_query('SELECT discount_id, name FROM {uc_discounts} ORDER BY name');
foreach ($result as $discount) {
$options[$discount->discount_id] = $discount->name;
}
$form['discount_id'] = array(
'#type' => 'select',
'#title' => t('Discount'),
'#options' => $options,
'#multiple' => TRUE,
'#default_value' => $settings['discount_id'],
'#description' => t('Select the discounts which, if the user has successfuly applied them to their order, should trigger this condition.'),
);
return $form;
}