diff -rup ubercart_marketplace_old/mp_marketplace/mp_marketplace.admin.inc ubercart_marketplace/mp_marketplace/mp_marketplace.admin.inc
--- ubercart_marketplace_old/mp_marketplace/mp_marketplace.admin.inc	2010-06-17 03:59:16.000000000 +0100
+++ ubercart_marketplace/mp_marketplace/mp_marketplace.admin.inc	2010-10-26 22:12:51.000000000 +0100
@@ -58,6 +58,25 @@ function mp_marketplace_settings_seller_
       '#default_value' => variable_get('mp_products_commission_rate', '.75'),
     '#size' => 10,
   );
+  $form['mp_product_fieldset']['commission_fieldset']['mp_products_commission_rate_flat'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Commission Flat Rate (Default)'),
+      '#description' => t('Enter a flat rate for the commission that will be deducted from the seller\'s profit. You can configure the interplay between the flat rate and the relative rate using the options below.'),
+      '#default_value' => variable_get('mp_products_commission_rate_flat', '0'),
+      '#size' => 10,
+  );
+  $form['mp_product_fieldset']['commission_fieldset']['mp_products_commission_flat_min'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Flat rate should act as a minimum commissioned amount'),
+      '#description' => t('Will make sure that the commission calculated based on the percentage setting is never smaller than the flat rate amount.'),
+      '#default_value' => variable_get('mp_products_commission_flat_min', FALSE),
+  );
+  $form['mp_product_fieldset']['commission_fieldset']['mp_products_commission_flat_waive'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Waive flat rate commission if the total commission amount exceeds the sale amount'),
+      '#description' => t('Will avoid charging the full sale price as the commission in case that the sum of flat rate and the percentage rate exceed the actual sale amount. Note: this setting has no effect if you select the flat rate to act as a minimum commission.'),
+      '#default_value' => variable_get('mp_products_commission_flat_waive', FALSE),
+  );
   $form['mp_product_fieldset']['commission_fieldset']['mp_products_auto_calc'] = array(
       '#type' => 'checkbox',
       '#title' => t('"Read Only" seller commission field'),
@@ -149,4 +168,4 @@ function mp_marketplace_removetab($label
       $vars['tabs'] .= $tab . "\n";
     }
   }
-}
\ No newline at end of file
+}
diff -rup ubercart_marketplace_old/mp_orders/mp_orders.module ubercart_marketplace/mp_orders/mp_orders.module
--- ubercart_marketplace_old/mp_orders/mp_orders.module	2010-06-15 05:25:54.000000000 +0100
+++ ubercart_marketplace/mp_orders/mp_orders.module	2010-10-26 22:12:51.000000000 +0100
@@ -113,23 +113,7 @@ function mp_orders_order($op, &$order, $
         if (isset($product->data['kit_id'])) {
           $sid = db_result(db_query("SELECT uid FROM {node} WHERE nid = %d", $product->nid));
           $seller = user_load(array('uid' => $sid));
-          $seller_roles = array_keys($seller->roles);
-          $roles_array = array_keys(user_roles(true, 'act as seller'));
-          $rid = -1;
-          foreach ($seller_roles as $role) {
-            if (in_array($role, $roles_array)) {
-              $rid = $role;
-            }
-          }
-          $result = db_result(db_query("SELECT rate FROM {mp_seller_rates} WHERE class = 'product_kit' AND rid = %d", $rid));
-          $commission = 0;
-          if ($result > 0) {
-            $commission = floatval($result);
-          }
-          else {
-            $commission = floatval(variable_get('mp_products_commission_rate', '.75'));
-          }
-          $product->cost = $product->price * $commission;
+          $product->cost = mp_products_calculate_cost($product->price, 'product_kit', $seller);
           db_query("UPDATE {uc_order_products} SET cost = %f WHERE order_product_id = %d", round($product->cost, 2), $product->order_product_id);
         }
       }
@@ -563,4 +547,4 @@ function mp_orders_mail($key, &$message,
       $message['body'] = $body;
     break;
   }
-}
\ No newline at end of file
+}
diff -rup ubercart_marketplace_old/mp_products/mp_products.module ubercart_marketplace/mp_products/mp_products.module
--- ubercart_marketplace_old/mp_products/mp_products.module	2010-06-17 03:59:15.000000000 +0100
+++ ubercart_marketplace/mp_products/mp_products.module	2010-10-26 22:12:49.000000000 +0100
@@ -187,14 +187,13 @@ function mp_products_nodeapi(&$node, $op
   if (in_array($node->type, $product_types)) {
     switch ($op) {
       case 'presave':
-        $commission_rate = mp_products_get_commission_rate($node->type);
         // auto calc commission if enabled and needed
         if (variable_get('mp_products_auto_calc', FALSE) && !(user_access('administer sellers') && variable_get('mp_products_admin_override', FALSE))) {
           if (variable_get('mp_products_auto_calc_field', 'sell_price') == 'list_price') {
-            $node->cost = $node->list_price * $commission_rate;
+            $node->cost = mp_products_calculate_cost($node->list_price, $node->type);
           }
           else {
-            $node->cost = $node->sell_price * $commission_rate;
+            $node->cost = mp_products_calculate_cost($node->sell_price, $node->type);
           }
         }
         // invoke hook_list_product()
@@ -230,8 +229,10 @@ function mp_products_nodeapi(&$node, $op
   }
 }
 
-function mp_products_get_commission_rate($type) {
-  global $user;
+function mp_products_get_commission_rate($type, $user = None) {
+  if (!$user) {
+    global $user;
+  }
   $user_roles = array_keys($user->roles);
   $roles_array = array_keys(user_roles(true, 'act as seller'));
   $rid = -1;
@@ -248,3 +249,31 @@ function mp_products_get_commission_rate
     return floatval(variable_get('mp_products_commission_rate', '.75'));
   }
 }
+
+function mp_products_calculate_cost($price, $type) {
+  $commission_rate = mp_products_get_commission_rate($type);
+  $commission_rate_flat = floatval(variable_get('mp_products_commission_rate_flat', '0'));
+  $commission_flat_min = variable_get('mp_products_commission_flat_min', FALSE);
+  $commission_flat_waive = variable_get('mp_products_commission_flat_waive', FALSE);
+  
+  $commission = $price * (1 - $commission_rate);
+  if ($commission_rate_flat !== '0') {
+    if ($commission_flat_min) {
+      if ($commission_rate_flat > $commission) {
+        $commission = $commission_rate_flat;
+      }
+    } else {
+      $commission = $commission + $commission_rate_flat;
+      if ($commission > $price) {
+        if ($commission_flat_waive) {
+          $commission = $commission - $commission_rate_flat;
+        } else {
+          $commission = $price;
+        }
+      }
+    }
+  }
+  
+  $cost = $price - $commission;
+  return $cost;
+}
