You are here

public function MailchimpEcommerceSyncOrders::buildForm in Mailchimp E-Commerce 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 FormInterface::buildForm

2 calls to MailchimpEcommerceSyncOrders::buildForm()
MailchimpEcommerceCommerceSyncOrders::buildForm in modules/mailchimp_ecommerce_commerce/src/Form/MailchimpEcommerceCommerceSyncOrders.php
Form constructor.
MailchimpEcommerceUbercartSyncOrders::buildForm in modules/mailchimp_ecommerce_ubercart/src/Form/MailchimpEcommerceUbercartSyncOrders.php
Form constructor.
2 methods override MailchimpEcommerceSyncOrders::buildForm()
MailchimpEcommerceCommerceSyncOrders::buildForm in modules/mailchimp_ecommerce_commerce/src/Form/MailchimpEcommerceCommerceSyncOrders.php
Form constructor.
MailchimpEcommerceUbercartSyncOrders::buildForm in modules/mailchimp_ecommerce_ubercart/src/Form/MailchimpEcommerceUbercartSyncOrders.php
Form constructor.

File

src/Form/MailchimpEcommerceSyncOrders.php, line 20

Class

MailchimpEcommerceSyncOrders

Namespace

Drupal\mailchimp_ecommerce\Form

Code

public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
  $form['sync_orders'] = [
    '#type' => 'checkbox',
    '#title' => t('Sync Orders'),
    '#description' => t('Sync all existing Orders to Mailchimp.'),
  ];
  $form['timespan'] = [
    '#type' => 'textfield',
    '#title' => t('Time span'),
    '#default_value' => 6,
    '#field_suffix' => 'months',
    '#description' => 'Mailchimp recommends syncing the past 6 months of order data. Leave blank to sync all orders.',
    '#size' => 3,
    '#maxlength' => 3,
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Sync with Mailchimp'),
    '#button_type' => 'primary',
  ];
  return $form;
}