Index: ubercart/uc_attribute/uc_attribute.module
===================================================================
--- ubercart/uc_attribute/uc_attribute.module	(revision 222)
+++ ubercart/uc_attribute/uc_attribute.module	(working copy)
@@ -274,18 +274,22 @@
  * Stores the customer's choices in the cart.
  */
 function uc_attribute_add_to_cart_data($form_values) {
-  $combination = array();
   if (!isset($form_values['attributes'])) {
     return array('attributes' => array(), 'model' => null);
   }
+  $combination = array();
   foreach ($form_values['attributes'] as $aid => $value) {
     if (is_numeric($value)) {
-      $combination[$aid] = $value;
+      $attribute = uc_attribute_load($aid, $form_values['nid'], 'product');
+      if ($attribute && ($attribute->display == 1 || $attribute->display == 2)) {
+        $combination[$aid] = $value;
+      }
     }
   }
+  ksort($combination);
   $result = db_query("SELECT model FROM {uc_product_adjustments} WHERE nid = %d AND combination LIKE '%s'", $form_values['nid'], serialize($combination));
   $model = db_result($result);
-  // drupal_set_message('Attributes to add to order Array(aid => oid):<pre>'. print_r($form_values['attributes'], true) . $model .'</pre>');
+
   // Preserve the 'attributes' key to allow other modules to add to the data field.
   return array('attributes' => $form_values['attributes'], 'model' => $model);
 }
