=== modified file 'uc_discount.module'
--- uc_discount.module	2009-04-18 07:10:04 +0000
+++ uc_discount.module	2009-05-05 13:39:13 +0000
@@ -71,18 +71,36 @@
 
 function uc_discount_price_handler_alter(&$price_info, &$context, &$options) {
   global $user;
-  static $prices;
+  static $prices = array('node_prices' => array(), 'cart_prices' => array());
+
   if (isset($context['subject']['node']) && (!isset($context['subject']['field']) || $context['subject']['field'] == 'sell_price')) {
     $node = $context['subject']['node'];
-    if (!isset($prices[$node->nid])) {
-      ca_pull_trigger('calculate_product_discounts', $node, $user);
-      $prices[$node->nid] = $node->sell_price;
+    $cache = 'node_prices';
+  }
+  else if (isset($context['extras']['node']) && isset($context['subject']['cart_item'])) {
+    $node = clone $context['extras']['node'];
+    $item = $context['subject']['cart_item'];
+    if (isset($context['subject']['field']) && isset($item->{$context['subject']['field']})) {
+      $node->sell_price = $item->{$context['subject']['field']};
     }
     else {
-      $node->sell_price = $prices[$node->nid];
+      $node->sell_price = $item->price;
     }
-    $price_info['price'] = $node->sell_price;
-  }
+    $cache = 'cart_prices';
+  }
+  else {
+    // Nothing to do.
+    return;
+  }
+
+  if (!isset($prices[$cache][$node->nid])) {
+    ca_pull_trigger('calculate_product_discounts', $node, $user);
+    $prices[$cache][$node->nid] = $node->sell_price;
+  }
+  else {
+    $node->sell_price = $prices[$cache][$node->nid];
+  }
+  $price_info['price'] = $node->sell_price;
 }
 
 /**
@@ -130,7 +148,8 @@
       $context = array(
         'revision' => 'formatted',
         'location' => 'tax-changes-log',
-        'subject' => array(
+        'subject' => array(),
+        'extras' => array(
           'order' => $arg1,
         ),
       );

