You are here

public static function CombinationOffer::ajaxCallback in Commerce Core 8.2

Ajax callback.

File

modules/promotion/src/Plugin/Commerce/PromotionOffer/CombinationOffer.php, line 205

Class

CombinationOffer
Provides the 'combination_offer' offer plugin.

Namespace

Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer

Code

public static function ajaxCallback(array $form, FormStateInterface $form_state) {
  $triggering_element = $form_state
    ->getTriggeringElement();
  $parents = $triggering_element['#array_parents'];
  $form_index = array_search('form', $parents, TRUE);
  $parents = array_splice($parents, 0, $form_index + 1);
  return NestedArray::getValue($form, $parents);
}