function uc_views_views_data_alter in Ubercart Views 6.3
Implementation of hook_views_data_alter().
File
- views/
uc_views.views.inc, line 855 - Views 2 hooks and callback registries.
Code
function uc_views_views_data_alter(&$data) {
$data['node']['table']['join']['uc_order_products'] = array(
'left_field' => 'nid',
'field' => 'nid',
);
$data['node']['table']['join']['uc_orders'] = array(
'left_table' => 'uc_order_products',
'left_field' => 'nid',
'field' => 'nid',
);
$data['node']['table']['join']['uc_cart_products'] = array(
'left_field' => 'nid',
'field' => 'nid',
);
$data['users']['table']['join']['uc_orders'] = array(
'left_field' => 'uid',
'field' => 'uid',
);
/*
$data['users']['table']['join']['uc_cart_products'] = array(
'left_field' => 'cart_id',
'field' => 'uid',
);
*/
$data['users_roles']['table']['join']['uc_orders'] = array(
'left_table' => 'users',
'left_field' => 'uid',
'field' => 'uid',
);
$data['term_node']['table']['join']['uc_orders'] = array(
'left_table' => 'uc_order_products',
'left_field' => 'nid',
'field' => 'nid',
);
$data['uc_products']['table']['join']['uc_order_products'] = array(
'left_field' => 'nid',
'field' => 'nid',
);
$data['uc_products']['table']['join']['uc_cart_products'] = array(
'left_field' => 'nid',
'field' => 'nid',
);
$data['uc_products']['conditionalbuyitnowbutton'] = array(
'title' => t('Conditional buy it now button'),
'help' => t('A button to add a product to the cart without quantity or attribute fields, if certain conditions are met.'),
'group' => t('Product'),
'field' => array(
'table' => 'node',
'additional fields' => array(
'nid' => array(
'table' => 'node',
'field' => 'nid',
),
),
'handler' => 'uc_views_handler_field_conditional_buyitnow',
),
);
$data['uc_products']['conditionaladdtocart'] = array(
'title' => t('Conditional add to cart form'),
'help' => t("Form to put the product in the customer's cart, if certain conditions are met."),
'group' => t('Product'),
'field' => array(
'additional fields' => array(
'nid' => array(
'table' => 'node',
'field' => 'nid',
),
'type' => array(
'table' => 'node',
'field' => 'type',
),
),
'handler' => 'uc_views_handler_field_conditional_addtocart',
),
);
$data['uc_products']['ordering']['field'] = array(
'help' => t("The product list position."),
'handler' => 'views_handler_field_numeric',
);
}