You are here

function uc_product_views_default_views in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_product/views/uc_product.views_default.inc \uc_product_views_default_views()
  2. 7.3 uc_product/views/uc_product.views_default.inc \uc_product_views_default_views()

Provide a default products view.

File

uc_product/uc_product.module, line 1303
The product module for Ubercart.

Code

function uc_product_views_default_views() {
  $view = new stdClass();
  $view->name = 'products';
  $view->description = 'products';
  $view->access = array();
  $view->view_args_php = '';
  $view->page = TRUE;
  $view->page_title = 'Products';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'table';
  $view->url = 'products';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->menu = TRUE;
  $view->menu_title = '';
  $view->menu_tab = FALSE;
  $view->menu_tab_weight = '0';
  $view->menu_tab_default = FALSE;
  $view->menu_tab_default_parent = NULL;
  $view->menu_tab_default_parent_type = 'tab';
  $view->menu_parent_tab_weight = '0';
  $view->menu_parent_title = '';
  $view->sort = array(
    array(
      'tablename' => 'uc_products',
      'field' => 'ordering',
      'sortorder' => 'ASC',
      'options' => '',
    ),
    array(
      'tablename' => 'node',
      'field' => 'title',
      'sortorder' => 'ASC',
      'options' => '',
    ),
  );
  $view->argument = array();
  $view->field = array(
    array(
      'tablename' => 'node_data_field_image_cache',
      'field' => 'field_image_cache_fid',
      'label' => 'Image(s)',
      'handler' => 'content_views_field_handler_group',
      'options' => 'product_list_linked',
    ),
    array(
      'tablename' => 'node',
      'field' => 'title',
      'label' => 'Description',
      'handler' => 'views_handler_field_nodelink',
      'sortable' => '1',
      'options' => 'link',
    ),
    array(
      'tablename' => 'uc_products',
      'field' => 'sell_price',
      'label' => 'Price',
      'sortable' => '1',
    ),
  );
  $view->filter = array(
    array(
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array(
      'tablename' => 'uc_products',
      'field' => 'is_product',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array();
  $view->requires = array(
    'node_data_field_image_cache',
    'node',
    'uc_products',
  );
  $views[$view->name] = $view;
  return $views;
}