Index: uc_node_checkout.module =================================================================== --- uc_node_checkout.module +++ uc_node_checkout.module @@ -970,5 +970,15 @@ else { return ''; } } } + +/** + * Implementation of hook_views_api(). + */ +function uc_node_checkout_views_api() { + return array( + 'api' => 2, + ); +} + ADDED uc_node_checkout.views.inc Index: uc_node_checkout.views.inc =================================================================== --- uc_node_checkout.views.inc +++ uc_node_checkout.views.inc @@ -1,0 +1,56 @@ + array( + 'left_field' => 'nid', + 'field' => 'nid', + 'type' => 'LEFT', + ), + 'uc_order_products' => array( + 'left_field' => 'order_product_id', + 'field' => 'order_product_id', + 'type' => 'LEFT', + ), + ); + + $data['uc_node_checkout_order_products']['order_product_id'] = array( + 'title' => t('UC Node Checkout order product'), + 'help' => t('Relate a purchased node to its UC Node Checkout order product.'), + 'relationship' => array( + 'handler' => 'views_handler_relationship', + 'base' => 'uc_order_products', + 'base field' => 'order_product_id', + 'field' => 'order_product_id', + 'label' => t('UC Node Checkout order product'), + ), + ); + + $data['uc_node_checkout_order_products']['nid'] = array( + 'title' => t('UC Node Checkout node'), + 'help' => t('Relate an order product to UC Node Checkout created node.'), + 'relationship' => array( + 'handler' => 'views_handler_relationship', + 'base' => 'node', + 'base field' => 'nid', + 'field' => 'nid', + 'label' => t('UC Node Checkout node'), + ), + ); + + return $data; +}