You are here

function uc_op_products_customer_table in Ubercart 7.3

Builds the order customer's view products table.

1 string reference to 'uc_op_products_customer_table'
uc_order_pane_products in uc_order/uc_order.order_pane.inc
Handles the "Products" order pane.

File

uc_order/uc_order.order_pane.inc, line 1120
This file contains the callbacks for the default order panes supplied with Ubercart and their corresponding helper functions.

Code

function uc_op_products_customer_table($order) {
  $table = array(
    '#type' => 'tapir_table',
    '#attributes' => array(
      'class' => array(
        'order-pane-table',
      ),
    ),
  );
  $table['#columns']['qty'] = array(
    'cell' => array(
      'data' => theme('uc_qty_label'),
      'class' => array(
        'qty',
      ),
    ),
    'weight' => 0,
  );
  $table['#columns']['product'] = array(
    'cell' => array(
      'data' => t('Product'),
      'class' => array(
        'product',
      ),
    ),
    'weight' => 1,
  );
  $table['#columns']['model'] = array(
    'cell' => array(
      'data' => t('SKU'),
      'class' => array(
        'sku',
      ),
    ),
    'weight' => 2,
  );
  if (user_access('administer products')) {
    $table['#columns']['cost'] = array(
      'cell' => array(
        'data' => t('Cost'),
        'class' => array(
          'cost',
        ),
      ),
      'weight' => 3,
    );
  }
  $table['#columns']['price'] = array(
    'cell' => array(
      'data' => t('Price'),
      'class' => array(
        'price',
      ),
    ),
    'weight' => 4,
  );
  $table['#columns']['total'] = array(
    'cell' => array(
      'data' => t('Total'),
      'class' => array(
        'total',
      ),
    ),
    'weight' => 5,
  );
  if (!empty($order->products)) {
    $build = uc_order_product_view_multiple($order->products);
    $table['#rows'] = $build['uc_order_product'];
  }
  else {
    $table['#rows'][]['product'] = array(
      '#markup' => t('This order contains no products.'),
      '#cell_attributes' => array(
        'colspan' => 'full',
      ),
    );
  }
  return $table;
}