Esempio n. 1
0
 /**
  * Submit handler for the views form.
  *
  * @param array $form
  *   An associative array containing the structure of the form.
  * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  */
 public function viewsFormSubmit(&$form, FormStateInterface $form_state)
 {
     $triggering_element = $form_state->getTriggeringElement();
     if (!empty($triggering_element['#remove_line_item'])) {
         $row_index = $triggering_element['#row_index'];
         $line_item = $this->getEntity($this->view->result[$row_index]);
         $this->cartManager->removeLineItem($line_item->getOrder(), $line_item);
     }
 }