public static function BuyXGetY::ajaxRefresh in Commerce Core 8.2
Ajax callback.
File
- modules/
promotion/ src/ Plugin/ Commerce/ PromotionOffer/ BuyXGetY.php, line 270
Class
- BuyXGetY
- Provides the "Buy X Get Y" offer for orders.
Namespace
Drupal\commerce_promotion\Plugin\Commerce\PromotionOfferCode
public static function ajaxRefresh(array $form, FormStateInterface $form_state) {
$parents = $form_state
->getTriggeringElement()['#array_parents'];
$parents = array_slice($parents, 0, -2);
return NestedArray::getValue($form, $parents);
}