--- uc_subproduct_original.module	2011-02-24 19:14:02.000000000 -0700
+++ uc_subproduct.module	2011-05-17 08:43:18.523773014 -0600
@@ -247,9 +247,13 @@ function uc_subproduct_form_alter(&$form
 function uc_subproduct_uc_subproduct_fields($node) {
   $fields = array();
   //get cck fields
-  $type_info = content_types('product'); //we only care about uc_product nodes
-  foreach ($type_info['fields'] as $field_name => $field) {
-    $fields[$field_name] = check_plain($field['widget']['label']);
+  $all_types = content_types(); //getting all cck fields since product does not get product classes
+  foreach ($all_types as $type_info) { //if the type is from the module uc_product then it is either a product or a product class
+	if ($type_info['module'] == 'uc_product') {
+      foreach ($type_info['fields'] as $field_name => $field) {
+        $fields[$field_name] = check_plain($field['widget']['label']);
+      }
+    }
   }
 
   //other Ubercart fields
@@ -281,12 +285,16 @@ function uc_subproduct_uc_subproduct_fie
 */
 function uc_subproduct_uc_subproduct_formatter($field, $node) {
   //get cck fields
-  $type_info = content_types('product'); //we only care about uc_product nodes
+  $all_types = content_types(); //getting all cck fields since product does not get product classes
   $cck = FALSE;
-  foreach ($type_info['fields'] as $field_name => $cck_field) {
-    if ($field_name == $field) {
-      $cck = TRUE;
-      break;
+  foreach ($all_types as $type_info) {
+	if ($type_info['module'] == 'uc_product') { //if the type is from the module uc_product then it is either a product or a product class
+      foreach ($type_info['fields'] as $field_name => $cck_field) {
+        if ($field_name == $field) {
+          $cck = TRUE;
+          break;
+	    }
+      }
     }
   }
   //take a clone so we can call drupal render without adverse effect
