diff --git a/uc_node_checkout.admin.inc b/uc_node_checkout.admin.inc
index ebdbfd9..0b6e2bd 100644
--- a/uc_node_checkout.admin.inc
+++ b/uc_node_checkout.admin.inc
@@ -12,7 +12,7 @@ function uc_node_checkout_admin() {
   $types = node_get_types('types');
   $rows = array();
 
-  $header = array(t('Node type'), t('Product'), t('View'), t('Actions'));
+  $header = array(t('Node type'), t('Product'), t('View'), t('Class'), t('Actions'));
 
   // Loop through all the node types on the site.
   foreach ($types as $type => $info) {
@@ -27,11 +27,15 @@ function uc_node_checkout_admin() {
     // Look for a View association.
     $view = variable_get('uc_node_checkout_'. $type .'_view', '');
 
+    // Look for a product class association.
+    $class = uc_product_class_load($nc_map[$type]['pcid']);
+
     // Add the node type's data to the table.
     $rows[] = array(
       $info->name,
       $product ? l($product->model, 'node/'. $product->nid) : t('n/a'),
       $nc_map[$type]['view'] ? check_plain($nc_map[$type]['view']) : t('n/a'),
+      $class ? l($class->name, 'admin/store/products/classes/' . $class->pcid) : t('n/a'),
       l(t('edit'), 'admin/store/settings/node-checkout/'. $type),
     );
   }
@@ -39,18 +43,11 @@ function uc_node_checkout_admin() {
   return theme('table', $header, $rows);
 }
 
-// Displays the form to map a product to a node type.
+// Displays the form to map a product, view, or product class to a node type.
 function uc_node_checkout_type_form(&$form_state, $type) {
   $nc_map = uc_node_checkout_product_map();
   $form = array();
 
-  $options = array(0 => t('<None>'));
-
-  $result = db_query("SELECT n.nid, p.model, n.title FROM {uc_products} AS p INNER JOIN {node} AS n ON p.vid = n.vid ORDER BY p.model");
-  while ($product = db_fetch_object($result)) {
-    $options[$product->nid] = '('. $product->model .') '. $product->title;
-  }
-
   $form['type'] = array(
     '#type' => 'value',
     '#value' => $type->type,
@@ -86,6 +83,19 @@ function uc_node_checkout_type_form(&$form_state, $type) {
     );
   }
 
+  // create the form input to handle class selection
+  $classes = array('' => ' ');
+  $result = db_query("SELECT pcid, name FROM {uc_product_classes}");
+  while ($class = db_fetch_object($result)) $classes[$class->pcid] = check_plain($class->name);
+  $form['pcid'] = array(
+    '#type' => 'select',
+    '#title' => t('Product Class'),
+    '#description' => t('Optional.  If a product class is selected here, clicking on the "Add to Cart" button for any product in that class will prompt the user to create a node of this content type.<br />The created node, on order payment, will be linked to the product that the user chose to add to the cart.'),
+    '#options' => $classes,
+    '#default_value' => $nc_map[$type->type]['pcid'],
+  );
+
+
   $restrictions = variable_get('uc_node_checkout_'. $type->type .'_restrictions', array());
 
   $form['disable_preview'] = array(
@@ -127,10 +137,10 @@ function uc_node_checkout_type_form(&$form_state, $type) {
 
 function uc_node_checkout_type_form_submit($form, &$form_state) {
   // Save the product node ID.
-  if ($form_state['values']['product_nid'] || $form_state['values']['view']) {
-    db_query("UPDATE {uc_node_checkout_types} SET product_nid = %d, node_view = '%s' WHERE node_type = '%s'", $form_state['values']['product_nid'], $form_state['values']['view'], $form_state['values']['type']);
+  if ($form_state['values']['product_nid'] || $form_state['values']['view'] || $form_state['values']['pcid']) {
+    db_query("UPDATE {uc_node_checkout_types} SET product_nid = %d, node_view = '%s', product_class_pcid = '%s' WHERE node_type = '%s'", $form_state['values']['product_nid'], $form_state['values']['view'], $form_state['values']['pcid'], $form_state['values']['type']);
     if (!db_affected_rows()) {
-      db_query("INSERT INTO {uc_node_checkout_types} (node_type, product_nid, node_view) VALUES ('%s', %d, '%s')", $form_state['values']['type'], $form_state['values']['product_nid'], $form_state['values']['view']);
+      db_query("INSERT INTO {uc_node_checkout_types} (node_type, product_nid, node_view, product_class_pcid) VALUES ('%s', %d, '%s', '%s')", $form_state['values']['type'], $form_state['values']['product_nid'], $form_state['values']['view'], $form_state['values']['pcid']);
     }
   }
   else {
diff --git a/uc_node_checkout.install b/uc_node_checkout.install
index ffd250c..b4e086e 100644
--- a/uc_node_checkout.install
+++ b/uc_node_checkout.install
@@ -39,6 +39,12 @@ function uc_node_checkout_schema() {
         'not null' => TRUE,
         'default' => '',
       ),
+      'product_class_pcid' => array(
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '',
+      ),
     ),
     'indexes' => array(
       'node_type' => array('node_type'),
@@ -97,3 +103,16 @@ function uc_node_checkout_update_6200() {
 
   return $ret;
 }
+
+/**
+ * Implementation of hook_update_N().
+ */
+function uc_node_checkout_update_6201() {
+  $ret = array();
+
+  // Add the product_class_pcid column.
+  db_add_field($ret, 'uc_node_checkout_types', 'product_class_pcid', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
+
+  return $ret;
+}
+
diff --git a/uc_node_checkout.module b/uc_node_checkout.module
index 57613d5..46d62df 100644
--- a/uc_node_checkout.module
+++ b/uc_node_checkout.module
@@ -150,6 +150,16 @@ function uc_node_checkout_exit() {
 }
 
 /**
+ * Implementation of hook_views_api().
+ */
+function uc_node_checkout_views_api() {
+  return array(
+    'api' => '2.0',
+    'path' => drupal_get_path('module', 'uc_node_checkout') .'/views',
+  );
+}
+
+/**
  * Implementation of hook_user().
  */
 function uc_node_checkout_user($op, &$edit, &$user, $category = NULL) {
@@ -719,14 +729,14 @@ function uc_node_checkout_product_map($type = '') {
   // The only limitation here is that the static caching will have no effect
   // when this module is enabled but no associations have been made.
   if (empty($nc_map)) {
-    $result = db_query("SELECT node_type, product_nid, node_view FROM {uc_node_checkout_types}");
+    $result = db_query("SELECT node_type, product_nid, node_view, product_class_pcid FROM {uc_node_checkout_types}");
 
     while ($nc_type = db_fetch_array($result)) {
-      $nc_map[$nc_type['node_type']] = array('nid' => $nc_type['product_nid'], 'view' => $nc_type['node_view']);
+      $nc_map[$nc_type['node_type']] = array('nid' => $nc_type['product_nid'], 'view' => $nc_type['node_view'], 'pcid' => $nc_type['product_class_pcid']);
     }
   }
 
-  // If we passed in a node type, return that node type's product nid.
+  // If we passed in a node type, return that node type's map entry.
   if (!empty($type)) {
     return $nc_map[$type];
   }
@@ -745,7 +755,7 @@ function uc_node_checkout_product_map($type = '') {
 function uc_node_checkout_node_associated($node) {
   // Return TRUE if a product node has been associated to this node type.
   if ($nc_map = uc_node_checkout_product_map($node->type)) {
-    if ($nc_map['nid'] || $nc_map['view']) {
+    if ($nc_map['nid'] || $nc_map['view'] || $nc_map['pcid']) {
       return TRUE;
     }
   }
@@ -798,6 +808,18 @@ function uc_node_checkout_node_type_association($product_nid) {
     }
   }
 
+  // If neither a specific product nid nor a view has been specified for the content type,
+  // check to see if this product's class has a content type association
+  $product_node = node_load($product_nid);
+  foreach (uc_node_checkout_product_map() as $type => $value) {
+    // Product classes seem to be defined by the equality of their pcid's with content type strings;
+    // this basically works like a foreign key that's not-so-clearly-documented as such.
+    if ($value['pcid'] == $product_node->type) {
+      // We have a winner.
+      return $type;
+    }
+  }
+    
   return FALSE;
 }
 
diff --git a/views/uc_node_checkout.views.inc b/views/uc_node_checkout.views.inc
new file mode 100644
index 0000000..83eff70
--- /dev/null
+++ b/views/uc_node_checkout.views.inc
@@ -0,0 +1,87 @@
+<?php
+// $Id$
+/**
+ * @file
+ * Views 2 hooks.
+ */
+
+/**
+ * Implementation of hook_views_data().
+ */
+function uc_node_checkout_views_data() {
+  // Make the uc_node_checkout_order_products table visible for Views
+  $data['uc_node_checkout_order_products']['table']['group'] = t('Ubercart Node Checkout');
+  $data['uc_node_checkout_order_products']['table']['base'] = array(
+    'field' => 'nid',
+    'title' => t('Node Checkout Order Products'),
+    'help' => t('Ubercart order products checked out through uc_node_checkout'),
+    'weight' => -10,
+  );
+  $data['uc_node_checkout_order_products']['table']['join']['node'] = array (
+    'left_field' => 'nid',
+    'field' => 'nid',
+  );
+  ##~~  $data['node']['table']['join']['uc_node_checkout_order_products'] = array (
+  ##~~    'left_field' => 'nid',
+  ##~~    'field' => 'nid',
+  ##~~  );
+  $data['uc_node_checkout_order_products']['nid'] = array (
+    'title' => t('Content Node NID'),
+    'help' => t('The Node ID of a content node that was created through Ubercart Node Checkout.'),
+    'relationship' => array (
+      'base' => 'node',
+      'field' => 'nid',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Content Node'),
+    ),
+  );
+
+  $data['uc_node_checkout_order_products']['table']['join']['uc_order_products'] = array (
+    'left_field' => 'order_product_id',
+    'field' => 'order_product_id',
+  );
+  $data['uc_order_products']['table']['join']['uc_node_checkout_order_products'] = array (
+    'left_field' => 'order_product_id',
+    'field' => 'order_product_id',
+  );
+  $data['uc_node_checkout_order_products']['order_product_id'] = array (
+    'title' => t('Order Product ID'),
+    'help' => t('The Order Product ID of a product that was ordered via Ubercart Node Checkout.'),
+    'relationship' => array (
+      'base' => 'uc_order_products',
+      'field' => 'order_product_id',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Order Product ID'),
+    ),
+  );
+
+  /**
+   * not sure why these don't work.
+  $data['uc_order_products']['nid'] = array (
+    'relationship' => array (
+      'base' => 'uc_node_checkout_order_products',
+      'field' => 'order_product_id',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Node Checkout NID'),
+##      'relationship field' => 'nid',
+    ),
+  );
+      
+
+  $data['uc_order_products_checkout']['table']['group'] = t('Ubercart Node Checkout');
+  $data['uc_order_products_checkout']['nid'] = array (
+    'title' => t('Order Products Checkout'),
+    'help' => t('Ubercart order products for which nodes were checked out'),
+    'relationship' => array (
+      'base' => 'uc_node_checkout_order_products',
+      'field' => 'order_product_id',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Node Checkout NID'),
+      'relationship table' => 'uc_order_products',
+    ),
+  );
+  /**/
+
+  return $data;
+}
+
