You are here

public static function UcAddress::updateZone in Ubercart 8.4

Ajax callback: updates the zone select box when the country is changed.

File

uc_store/src/Element/UcAddress.php, line 201

Class

UcAddress
Provides a form element for Ubercart address input.

Namespace

Drupal\uc_store\Element

Code

public static function updateZone($form, FormStateInterface $form_state) {
  $element =& $form;
  $triggering_element = $form_state
    ->getTriggeringElement();
  foreach (array_slice($triggering_element['#array_parents'], 0, -1) as $field) {
    $element =& $element[$field];
  }
  return $element['zone'];
}