You are here

function commerce_product_bundle_line_item_add_form in Commerce Product Bundle 7

Same name and namespace in other branches
  1. 7.2 commerce_product_bundle.module \commerce_product_bundle_line_item_add_form()

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

@TODO: Implement this method correct.

File

./commerce_product_bundle.module, line 1126
Allows the bundling of products in Drupal Commerce.

Code

function commerce_product_bundle_line_item_add_form($form_state) {
  $order = $form_state['commerce_order'];
  $form = array();
  $form['amount'] = array(
    '#type' => 'textfield',
    '#title' => t('Amount'),
    '#default_value' => $default_amount,
    '#size' => 10,
  );

  // Build a currency options list from all enabled currencies.
  $options = array();
  foreach (commerce_currencies(TRUE) as $currency_code => $currency) {
    $options[$currency_code] = check_plain($currency['code']);
  }
  $form['currency_code'] = array(
    '#type' => 'select',
    '#title' => t('Currency'),
    '#options' => $options,
    '#default_value' => commerce_default_currency(),
  );
  return $form;
}