You are here

public function AjaxAddToCartForm::buildForm in Commerce Ajax Add to Cart 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides AddToCartForm::buildForm

File

src/Form/AjaxAddToCartForm.php, line 84

Class

AjaxAddToCartForm
Provides the order item ajax add to cart form.

Namespace

Drupal\dc_ajax_add_cart\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $form['#attached']['library'][] = 'core/jquery.form';
  $form['#attached']['library'][] = 'core/drupal.ajax';
  return $form;
}