You are here

public function CommerceShippingExample::settings_form in Commerce Shipping 7

Settings form callback: adds our custom settings to the Rules action form.

Overrides CommerceShippingQuote::settings_form

File

modules/plugins/quotes/example_plugin/CommerceShippingExample.class.php, line 7

Class

CommerceShippingExample

Code

public function settings_form(&$form, $rules_settings) {
  $form['shipping_price'] = array(
    '#type' => 'textfield',
    '#title' => t('Shipping price'),
    '#description' => t('Configure what the shipping price per order should be.'),
    '#default_value' => is_array($rules_settings) && isset($rules_settings['shipping_price']) ? $rules_settings['shipping_price'] : 42,
    '#element_validate' => array(
      'rules_ui_element_decimal_validate',
    ),
  );
}