Index: sites/all/modules/uc_price_per_role/uc_price_per_role.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/uc_price_per_role/uc_price_per_role.module	(revision 1:bb3f3ca6c673)
+++ sites/all/modules/uc_price_per_role/uc_price_per_role.module	(revision 1+:bb3f3ca6c673+)
@@ -249,7 +249,37 @@
       }
     }
   }
+
+  switch($form_id) {
+    case 'product_kit_node_form' :
+//      dargs();
+      if($form['base'] && $form['base']['items']) {
+        foreach($form['base']['items'] as $key => $value) {
+          if(is_numeric($key)) {
+
+            $product = $form['#node']->products[$key];
+            $role_prices = $product->role_prices;
+
+            $enabled = variable_get('uc_price_per_role_enabled', array());
+            foreach (user_roles() as $rid => $role) {
+              if ($enabled[$rid]) {
+                $form['base']['items'][$key]['role_prices'][$rid] = array(
+                  '#type'                 => 'textfield',
+                  '#title'                => t('%role price', array('%role' => $role)),
+                  '#value'                => isset($role_prices[$rid]) ? uc_store_format_price_field_value($role_prices[$rid]) : '',
+                  '#description'          => t('Purchase price for %role users.', array('%role' => $role)),
+                  '#field_prefix'         => variable_get('uc_sign_after_amount', FALSE) ? '' : variable_get('uc_currency_sign', '$'),
+                  '#field_suffix'         => variable_get('uc_sign_after_amount', FALSE) ? variable_get('uc_currency_sign', '$') : '',
+                  '#disabled'             => TRUE,
+                );
-}
+              }
+            }
+          }
+        }
+      }
+      break;
+  }
+}
 
 function theme_uc_price_per_role_product_prices($prices) {
   $output = '<table><tr>';
@@ -291,10 +321,25 @@
         break;
 
       case 'load':
-        $result = db_query("SELECT rid, price FROM {uc_price_per_role_prices} WHERE vid = %d", $node->vid);
         $prices = array();
+        if($node->type == 'product_kit') {
+          $uc_price_per_role_enabled = variable_get('uc_price_per_role_enabled', array());
+          foreach($node->products as $nid => $product) {
+              foreach($uc_price_per_role_enabled as $rid => $enabled) {
+                // if role is enabled
+                if($enabled) {
+                  $product_price = isset($product->role_prices[$rid]) ? $product->role_prices[$rid] : $product->sell_price;
+                  $prices[$rid] += $product_price;
+                }
+              }
+          }
+        }
+        else {
+          // for any node, without product_kit
+          $result = db_query("SELECT rid, price FROM {uc_price_per_role_prices} WHERE vid = %d", $node->vid);
-        while ($row = db_fetch_object($result)) {
-          $prices[$row->rid] = $row->price;
+          while ($row = db_fetch_object($result)) {
+            $prices[$row->rid] = $row->price;
+          }
         }
 
         $original_price = $node->sell_price;
@@ -348,7 +393,7 @@
 
   $role_prices = uc_price_per_role_load_option_prices($product->nid);
   $enabled = array_keys(array_filter(variable_get('uc_price_per_role_enabled', array())));
-  
+
   $form['help'] = array(
     '#value' => t('Leave any box blank to use the default price for the option.'),
   );
@@ -482,8 +527,8 @@
   }
 
   $output = drupal_render($form['help'])
-          . theme('table', $header, $rows, array('class' => 'product_attributes'))
-          . drupal_render($form);
+    . theme('table', $header, $rows, array('class' => 'product_attributes'))
+    . drupal_render($form);
 
   return $output;
 }
@@ -529,7 +574,7 @@
 
 /**
  * Find the price for the current user from the supplied price array.
- * 
+ *
  * Will return FALSE if no price was found.
  */
 function uc_price_per_role_find_price($prices) {
