function uc_product_table_header in Ubercart 6.2
Returns the table header for the product view table.
See also
3 calls to uc_product_table_header()
- theme_uc_catalog_browse in uc_catalog/
uc_catalog.pages.inc - Display a formatted catalog page.
- uc_product_administration in uc_product/
uc_product.admin.inc - Lists all products.
- uc_product_table in uc_product/
uc_product.module - Displays product fields in a TAPIr table.
File
- uc_product/
uc_product.module, line 1251 - The product module for Ubercart.
Code
function uc_product_table_header() {
static $columns = array();
if (empty($columns)) {
$enabled = uc_product_field_enabled();
if (module_exists('imagecache') && $enabled['image']) {
$columns['image'] = array(
'weight' => -5,
'cell' => array(
'data' => t('Image'),
),
);
}
$columns['name'] = array(
'weight' => 0,
'cell' => array(
'data' => t('Name'),
'field' => 'n.title',
),
);
if ($enabled['list_price']) {
$columns['list_price'] = array(
'weight' => 3,
'cell' => array(
'data' => t('List price'),
'field' => 'p.list_price',
),
);
}
if ($enabled['sell_price']) {
$columns['price'] = array(
'weight' => 5,
'cell' => array(
'data' => t('Price'),
'field' => 'p.sell_price',
),
);
}
if (module_exists('uc_cart') && (arg(0) != 'admin' || $_GET['q'] == 'admin/store/settings/tables/uc_product_table') && $enabled['add_to_cart']) {
$columns['add_to_cart'] = array(
'weight' => 10,
'cell' => array(
'data' => variable_get('uc_teaser_add_to_cart_text', t('Add to cart')),
'nowrap' => 'nowrap',
),
);
}
drupal_alter('tapir_table_header', $columns, 'uc_product_table');
}
return $columns;
}