=== modified file 'uc_attribute/uc_attribute.module'
--- uc_attribute/uc_attribute.module	2009-02-19 18:22:43 +0000
+++ uc_attribute/uc_attribute.module	2009-02-20 15:49:30 +0000
@@ -324,8 +324,8 @@
  * Ubercart Hooks                                                             *
  ******************************************************************************/
 
-/*
- * Implementation of hook_uc_produt_models().
+/**
+ * Implementation of hook_uc_product_models().
  */
 function uc_attribute_uc_product_models($node) {
   $models = array();
@@ -361,6 +361,20 @@
   return array('attributes' => $form_values['attributes'], 'model' => $model);
 }
 
+function uc_attribute_order_product_alter(&$product, $order) {
+  // Convert the attribute and option ids to their current names. This
+  // preserves the important data in case the attributes or options are
+  // changed later.
+  if (is_array($product->data['attributes']) && is_numeric(key($product->data['attributes']))) {
+    $attributes = array();
+    $options = _uc_cart_product_get_options($product);
+    foreach ($options as $aid => $option) {
+      $attributes[$option['attribute']] = $option['name'];
+    }
+    $product->data['attributes'] = $attributes;
+  }
+}
+
 /**
  * Implementation of hook_product_class().
  */

=== modified file 'uc_order/uc_order.admin.inc'
--- uc_order/uc_order.admin.inc	2009-02-18 14:38:33 +0000
+++ uc_order/uc_order.admin.inc	2009-02-20 15:13:41 +0000
@@ -1153,34 +1153,16 @@
       }
       break;
     case 'add':
+      $form_state['values'] = $_POST;
       $product = node_load(intval($_POST['nid']));
       $product->qty = intval($_POST['qty']);
       $product->price = $product->sell_price;
-      if (module_exists('uc_manufacturer')) {
-        $product->manufacturer = uc_product_get_manufacturer($product->nid);
-        $product->manufacturer = $product->manufacturer->name;
-      }
-      if (module_exists('uc_attribute')) {
-        $form_state['values'] = array(
-          'nid' => intval($_POST['nid']),
-          'attributes' => $_POST['attributes'],
-        );
-        $product->data = module_invoke_all('add_to_cart_data', $form_state['values']);
-        $attributes = array();
-        $product->options = _uc_cart_product_get_options($product);
-        foreach ($product->options as $option) {
-          $product->cost += $option['cost'];
-          $product->price += $option['price'];
-          $product->weight += $option['weight'];
-          $attributes[$option['attribute']] = $option['name'];
-        }
-        $product->data['attributes'] = $attributes;
-        $product->module = $product->data['module'];
-        if ($product->data['model']) {
-          $product->model = $product->data['model'];
-        }
-      }
+      $product->data = module_invoke_all('add_to_cart_data', $form_state['values']);
+
+      module_invoke_all('cart_item', 'load', $product);
+      drupal_alter('order_product', $product, $order);
       uc_order_product_save($order->order_id, $product);
+
       if (variable_get('uc_order_logging', TRUE)) {
         uc_order_log_changes($order->order_id, array('add' => 'Added ('. $product->qty .') '. $product->title .' to order.'));
       }

=== modified file 'uc_order/uc_order.js'
--- uc_order/uc_order.js	2008-12-01 20:07:55 +0000
+++ uc_order/uc_order.js	2009-02-20 18:23:35 +0000
@@ -308,11 +308,9 @@
   post_vars['nid'] = node_id;
   post_vars['qty'] = $('#edit-add-qty').val();
 
-  $('#uc-order-add-product-form :input').each(
+  $('#uc-order-add-product-form :input').not(':radio:not(:checked)').each(
     function() {
-      if ($(this).attr('name').substr(0, 10) == 'attributes') {
-        post_vars[$(this).attr('name')] = $(this).val();
-      }
+      post_vars[$(this).attr('name')] = $(this).val();
     }
   );
 

=== modified file 'uc_order/uc_order.module'
--- uc_order/uc_order.module	2009-02-13 15:43:12 +0000
+++ uc_order/uc_order.module	2009-02-19 19:41:58 +0000
@@ -1004,14 +1004,7 @@
   db_query("DELETE FROM {uc_order_products} WHERE order_id = %d", $order->order_id);
   if (is_array($order->products)) {
     foreach ($order->products as $product) {
-      if (module_exists('uc_attribute') && empty($order->modified)) {
-        $attributes = array();
-        $options = _uc_cart_product_get_options($product);
-        foreach ($options as $aid => $option) {
-          $attributes[$option['attribute']] = $option['name'];
-        }
-        $product->data['attributes'] = $attributes;
-      }
+      drupal_alter('order_product', $product, $order);
       uc_order_product_save($order->order_id, $product);
     }
   }

