function uc_attribute_condition_ordered_product_option_form in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_attribute/uc_attribute_workflow.inc \uc_attribute_condition_ordered_product_option_form()
See also
uc_attribute_condition_ordered_product_option()
File
- uc_attribute/
uc_attribute.ca.inc, line 85 - Conditional Actions file for Ubercart attributes.
Code
function uc_attribute_condition_ordered_product_option_form($form_state, $settings = array()) {
$form = array();
$options = array();
$result = db_query("SELECT a.aid, a.name AS attr_name, a.ordering, o.oid, o.name AS opt_name, o.ordering FROM {uc_attributes} AS a JOIN {uc_attribute_options} AS o ON a.aid = o.aid ORDER BY a.ordering, o.ordering");
while ($option = db_fetch_object($result)) {
$options[$option->attr_name][$option->oid] = $option->opt_name;
}
$form['attribute_option'] = array(
'#type' => 'select',
'#title' => t('Attribute option'),
'#default_value' => $settings['attribute_option'],
'#options' => $options,
);
return $form;
}