You are here

function uc_dropdown_attributes_order_ajax_callback in Dropdown Attributes 7

Same name and namespace in other branches
  1. 8 uc_dropdown_attributes.module \uc_dropdown_attributes_order_ajax_callback()

Ajax callback for order attribute selection form elements.

1 string reference to 'uc_dropdown_attributes_order_ajax_callback'
uc_dropdown_attributes_order_product_alter in ./uc_dropdown_attributes.module
Alter products on oder page in preparation for drop down attributes.

File

./uc_dropdown_attributes.module, line 878
Show/hide attributes based on the values of other attributes.

Code

function uc_dropdown_attributes_order_ajax_callback($form, $form_state) {
  if (in_array('sub_products', $form_state['triggering_element']['#parents'])) {

    // This is a product kit.
    $nid = $form_state['triggering_element']['#parents'][2];
    return $form['product_controls']['sub_products'][$nid]['attributes'];
  }
  return $form['product_controls']['attributes'];
}