function uc_dropdown_attributes_dependent_callback in Dropdown Attributes 8
Same name and namespace in other branches
- 7 dependent_dropdown.inc \uc_dropdown_attributes_dependent_callback()
AJAX callback for the uc_dropdown_attributes_product form.
2 string references to 'uc_dropdown_attributes_dependent_callback'
- ClassAttributeDependencies::buildForm in src/
Form/ ClassAttributeDependencies.php - Form constructor.
- ProductAttributeDependencies::buildForm in src/
Form/ ProductAttributeDependencies.php - Form constructor.
File
- ./
uc_dropdown_attributes.module, line 25 - A module for uc_dropdown_attributes.
Code
function uc_dropdown_attributes_dependent_callback($form, FormStateInterface $form_state) {
$trigger = $form_state
->getTriggeringElement();
$wrapper = explode('-', $trigger['#ajax']['wrapper']);
$attribute = $wrapper[1];
return $form['attributes'][$attribute]['values'];
}