--- uc_node_checkout.module	2009-03-29 22:13:45.000000000 -0400
+++ uc_node_checkout.module	2009-03-29 23:56:44.000000000 -0400
@@ -614,6 +614,17 @@
         }
       }
 
+      // Link to the corresponding order
+      if (isset($node->uc_order_product_id)) {
+        $q = db_query('SELECT {uc_order_products}.order_id, {uc_orders}.uid FROM {uc_order_products},{uc_orders} WHERE order_product_id = %d AND {uc_orders}.order_id = {uc_order_products}.order_id', $node->uc_order_product_id);
+        $result = db_fetch_array($q);
+        global $user;
+        $node->content['uc_node_checkout_order'] = array(
+          '#value' => l('Order '.$result['order_id'],'user/'.$result['uid'].'/order/'.$result['order_id']),
+          '#weight' => 10,
+        );
+      }
+
       break;
   }
 }
@@ -878,3 +889,54 @@
   return $products[$order_product_id];
 }
 
+
+/**
+ * Implementation of hook_order_pane()
+ */
+function uc_node_checkout_order_pane() {
+  $panes[] = array(
+    'id' => 'uc_node_checkout',
+    'callback' => 'uc_node_checkout_order_pane_nodes',
+    'title' => t('Custom Products'),
+    'class' => 'pos-left abs-left',
+    'weight' => 7,
+    'show' => array('view', 'customer'),
+  );
+  return $panes;
+}
+
+/**
+ * Handle the "Custom Products" order pane.
+ */
+function uc_node_checkout_order_pane_nodes($op, $arg1) {
+  switch ($op) {
+    case 'view':
+    case 'customer':
+      $order = $arg1;
+
+      $count = 0;
+      $output  = '<p>The following products in this order have customizations described below.</p>';
+      $output .= '<p>Please click each link to view more information.</p>';
+      $output .= '<ul>';
+      foreach($order->products as $product) {
+        if(!isset($product->data['node_checkout_nid'])) {
+          continue;
+        }
+        $node_checkout_node = node_load($product->data['node_checkout_nid']);
+        $output .= '<li>'
+          .l($product->title
+            .' (SKU '.$product->model.') - '
+            .$node_checkout_node->title,
+            'node/'.$node_checkout_node->nid)
+          .'</li>';
+        ++$count;
+      }
+      $output .= '<ul>';
+
+      if ($count) {
+        return $output;
+      } else {
+        return '';
+      }
+  }
+}
