You are here

function uc_dropdown_attributes_product in Dropdown Attributes 6

Same name and namespace in other branches
  1. 7 dependent_dropdown.inc \uc_dropdown_attributes_product()

Specify the attribute dependencies.

1 string reference to 'uc_dropdown_attributes_product'
uc_dropdown_attributes_menu in ./uc_dropdown_attributes.module
Implement hook_menu().

File

./dependent_dropdown.inc, line 14
Administrative interface for specifying the attribute dependencies.

Code

function uc_dropdown_attributes_product(&$form_state, $product) {
  $nid = $product->nid;
  $attributes = uc_product_get_attributes($nid);
  $query = 'SELECT aid, parent_aid, parent_values, required
    FROM {uc_dropdown_attributes} WHERE nid="%s"';
  $dependencies = db_query($query, $nid);
  _uc_dropdown_attributes_form($form, $form_state, $attributes, $dependencies);

  // Check for overriding product class dropdowns.
  $type = uc_dropdown_attributes_dependency_type($nid);
  if (!is_null($type) && $type == 'class') {
    $form['submit']['#value'] = t('Override product class');
  }
  return $form;
}