You are here

function uc_order_add_product_form in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_order/uc_order.module \uc_order_add_product_form()
  2. 7.3 uc_order/uc_order.order_pane.inc \uc_order_add_product_form()

Sets the quantity and attributes of a product added to the order.

See also

uc_order_add_product_form()

2 string references to 'uc_order_add_product_form'
uc_order_add_product in uc_order/uc_order.admin.inc
Intermediate div that lets you set the qty and attributes for a product.
uc_product_kit_uc_form_alter in uc_product_kit/uc_product_kit.module
Implements hook_uc_form_alter().

File

uc_order/uc_order.admin.inc, line 1669
Order administration menu items.

Code

function uc_order_add_product_form($form_state, $order, $node) {
  $form['nid'] = array(
    '#type' => 'hidden',
    '#value' => $node->nid,
  );
  $form['add-qty'] = array(
    '#type' => 'textfield',
    '#title' => t('Qty'),
    '#default_value' => '1',
    '#size' => 2,
    '#maxlength' => 5,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Add to order'),
    '#attributes' => array(
      'onclick' => 'return add_product_to_order(' . $order->order_id . ', ' . $node->nid . ');',
    ),
  );
  $form['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
    '#attributes' => array(
      'onclick' => "\$('#add-product-button').click(); return false;",
    ),
  );
  $form['node'] = array(
    '#type' => 'value',
    '#value' => $node,
  );
  uc_form_alter($form, $form_state, __FUNCTION__);
  return $form;
}