You are here

function commerce_shipping_line_item_add_form in Commerce Shipping 7

Same name and namespace in other branches
  1. 7.2 commerce_shipping.module \commerce_shipping_line_item_add_form()

Returns the elements necessary to add a shipping line item through a line item manager widget.

File

./commerce_shipping.module, line 191
Defines the shipping system and checkout integration.

Code

function commerce_shipping_line_item_add_form($form_state) {
  $order = $form_state['commerce_order'];
  $form = array();
  $form['shipping_method'] = array(
    '#type' => 'select',
    '#title' => t('Shipping method'),
    '#options' => commerce_shipping_get_shipping_methods_options(),
  );
  $form['amount'] = array(
    '#type' => 'textfield',
    '#title' => t('Amount'),
    '#default_value' => $default_amount,
    '#size' => 10,
  );
  $form['currency_code'] = array(
    '#type' => 'select',
    '#title' => t('Currency'),
    '#options' => commerce_currency_code_options_list(),
    '#default_value' => commerce_default_currency(),
  );
  return $form;
}