diff --git a/commerce/modules/cart/commerce_cart.module b/commerce/modules/cart/commerce_cart.module
index f5dbf1b..e97f2b8 100644
--- a/commerce/modules/cart/commerce_cart.module
+++ b/commerce/modules/cart/commerce_cart.module
@@ -1364,7 +1364,14 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
       $qualifying_fields = array();
       $same_type = TRUE;
       $type = '';
-
+      
+      if(!empty($form_state['values']['product_type'])) {                              
+        $type = $form_state['values']['product_type'];                                 
+      }                                                                                                                                                           
+      if(isset($form_state['values']['unchanged_product_type'])) {                     
+        $type_changed = $form_state['values']['unchanged_product_type'] != $type;      
+      }
+      
       // Find the default product so we know how to set default options on the
       // various Add to Cart form widgets and an array of any matching product
       // based on attribute selections so we can add a selection widget.
@@ -1372,6 +1379,26 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
       $default_product = NULL;
       $attribute_names = array();
       $unchanged_attributes = array();
+      
+      $product_types = array();
+
+      foreach($products as $product_id => $product) {
+        if(!in_array($product->type, $product_types)) { //set the default product for each product type.
+          $product_types[$product->type] = $product;
+        }
+      }
+      
+      if($type == '') {
+        $type = reset(array_keys($product_types));
+      }
+      
+      if(count($product_types) > 1) {
+        foreach($products as $product_id => $product) {
+          if($product->type != $type) {
+            unset($products[$product_id]);
+          }
+        }
+      }
 
       foreach ($products as $product_id => $product) {
         $product_wrapper = entity_metadata_wrapper('commerce_product', $product);
@@ -1383,15 +1410,15 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
 
         // If the current product type is different from the first, we are not
         // dealing with a set of same typed products.
-        if ($product->type != $type) {
-          $same_type = FALSE;
-        }
+        //if ($product->type != $type) {
+        //  $same_type = FALSE;
+        //}
 
         // If the form state contains a set of attribute data, use it to try
         // and determine the default product.
         $changed_attribute = NULL;
 
-        if (!empty($form_state['values']['attributes'])) {
+        if (!empty($form_state['values']['attributes']) && !$type_changed) {
           $match = TRUE;
 
           // Set an array of checked attributes for later comparison against the
@@ -1445,6 +1472,13 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
           }
         }
       }
+      
+      $same_type = count($product_types) <= 1;                                                                           
+                                                                                                                   
+      if($same_type && !empty($form_state['values']['product_type']) && $type_changed) {                                 
+        //has the product type changed? If so, we need to reset the default product to the first found in the type.      
+        $form_state['values']['product_id'] = $product_types[$type]->product_id;                                         
+      }                                                                                                                  
 
       // Set the default product now if it isn't already set.
       if (empty($matching_products)) {
@@ -1482,9 +1516,30 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
       $default_product_wrapper = entity_metadata_wrapper('commerce_product', $default_product);
 
       $form_state['default_product'] = $default_product;
-
+      
+      // If all the products are not of the same type, add a type selector.
+      if(!$same_type) {                                                             
+        foreach(array_keys($product_types) as $product_type) {                      
+          $product_type_data = commerce_product_type_load($product_type);           
+          $type_options[$product_type] = $product_type_data['name'];                
+        }                                                                           
+        $form['product_type'] = array(                                              
+          '#type'   => 'select',                                                    
+          '#default_value'  => $type,                                               
+          '#options'  => $type_options,                                             
+          '#ajax' => array(                                                         
+            'callback' => 'commerce_cart_add_to_cart_form_attributes_refresh',      
+          ),                                                                        
+          '#title'  => t('Product Type'),                                           
+          '#weight' => -40                                                          
+        );                                                                          
+        $form['unchanged_product_type'] = array(                                    
+          '#type'   => 'value',                                                     
+          '#value'  => $type                                                        
+        );                                       
+      }
       // If all the products are of the same type...
-      if ($same_type) {
+      //if ($same_type) {
         // Loop through all the field instances on that product type.
         foreach (field_info_instances('commerce_product', $type) as $name => $instance) {
           // A field qualifies if it is single value, required and uses a widget
@@ -1534,7 +1589,7 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
             }
           }
         }
-      }
+      //}
 
       // Otherwise for products of varying types, display a simple select list
       // by product title.
@@ -1658,7 +1713,7 @@ function commerce_cart_add_to_cart_form($form, &$form_state, $line_item, $show_q
 
       // If the products referenced were of different types or did not posess
       // any qualifying attribute fields, add a product selection widget.
-      if (!$same_type || empty($qualifying_fields)) {
+      if (empty($qualifying_fields)) {
         $options = array();
 
         foreach ($products as $product_id => $product) {
