? uc_node_checkout_content_type.patch
? uc_node_checkout_views_relationship.patch
Index: uc_node_checkout.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_node_checkout/uc_node_checkout.module,v
retrieving revision 1.8.2.4
diff -u -p -r1.8.2.4 uc_node_checkout.module
--- uc_node_checkout.module	30 Jan 2009 16:59:04 -0000	1.8.2.4
+++ uc_node_checkout.module	24 Jul 2009 01:02:35 -0000
@@ -878,3 +878,11 @@ function uc_node_checkout_load_order_pro
   return $products[$order_product_id];
 }
 
+/**
+ * Implementation of hook_views_api().
+ */
+function uc_node_checkout_views_api() {
+  return array(
+    'api' => 2,
+  );
+}
Index: uc_node_checkout.views.inc
===================================================================
RCS file: uc_node_checkout.views.inc
diff -N uc_node_checkout.views.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ uc_node_checkout.views.inc	24 Jul 2009 01:02:35 -0000
@@ -0,0 +1,29 @@
+<?php
+/*
+ * Creates a Views 2 relationship between the
+ * product and the associated purchased node *
+ *
+ * Implementation of hook_views_data().
+ */
+function uc_node_checkout_views_data() {
+
+  $data['uc_node_checkout_order_products']['table']['group'] = t('UC Node Checkout');
+
+  $data['uc_node_checkout_order_products']['table']['join']['node'] = array(
+    'left_field' => 'nid',
+    'field' => 'nid',
+  );
+
+  $data['uc_node_checkout_order_products']['order_product_id'] = array(
+    'relationship' => array(
+      'title' =>  t('Related product'),
+      'help' => t('The product node related via UC node checkout'),
+      'handler' => 'views_handler_relationship',
+      'base' => 'node',
+      'field' => 'nid',
+      'label' => t('Related product'),
+    ),
+  );
+  return $data;
+}
+
