=== modified file 'uc_discount.ca.inc'
--- uc_discount.ca.inc	2009-03-13 14:30:16 +0000
+++ uc_discount.ca.inc	2009-04-11 20:34:54 +0000
@@ -297,7 +297,9 @@
  * Wrapper function for product discounts.
  */
 function uc_discount_get_product_discount($product, $settings) {
+  dpm($product);
   $product->sell_price += uc_discount_get_discount($product, $settings);
+  dpm($product->sell_price);
 }
 
 /**

=== modified file 'uc_discount.module'
--- uc_discount.module	2009-03-13 14:30:16 +0000
+++ uc_discount.module	2009-04-11 20:33:59 +0000
@@ -52,22 +52,30 @@
   }
 }
 
-function uc_discount_nodeapi(&$node, $op, $arg3 = NULL, $arg4 = NULL) {
-  switch ($op) {
-    case 'load':
-      global $user;
-
-      if (uc_product_is_product($node)) {
-        ca_pull_trigger('calculate_product_discounts', $node, $user);
-      }
-      break;
-  }
-}
-
 /******************************************************************************
  * Ubercart hooks                                                             *
  ******************************************************************************/
 
+function uc_discount_uc_price_handler() {
+  return array(
+    'alter' => array(
+      'title' => t('Discount price handler'),
+      'description' => t('Adds discounts to product prices.'),
+      'callback' => 'uc_discount_price_handler_alter',
+    ),
+  );
+}
+
+function uc_discount_price_handler_alter(&$price_info, &$context, &$options) {
+  global $user;
+  if (isset($context['subject']['node'])) {
+    $node = $context['subject']['node'];
+    ca_pull_trigger('calculate_product_discounts', $node, $user);
+
+    $price_info['price'] = $node->sell_price;
+  }
+}
+
 /**
  * Update and save discount line items to the order.
  */
@@ -642,17 +650,19 @@
   foreach ($predicates as $predicate) {
     if (ca_evaluate_conditions($predicate, $arguments)) {
       $discounts = ca_perform_actions($predicate, $arguments);
-      foreach ($discounts as $i => $discount) {
-        if ($predicate['#actions'][$i]['#name'] == 'uc_discount_action_get_order_discount' && $discount) {
-          // Allow successive discounts to inspect this discount by putting
-          // it in the order object.
-          $order->discounts[$id] = array(
-            'id' => $id,
-            'title' => check_plain($predicate['#actions'][$i]['#title']),
-            'amount' => $discount,
-            'weight' => $predicate['#actions'][$i]['#settings']['line_item_weight'],
-          );
-          $id++;
+      if (is_array($discounts)) {
+        foreach ($discounts as $i => $discount) {
+          if ($predicate['#actions'][$i]['#name'] == 'uc_discount_action_get_order_discount' && $discount) {
+            // Allow successive discounts to inspect this discount by putting
+            // it in the order object.
+            $order->discounts[$id] = array(
+              'id' => $id,
+              'title' => check_plain($predicate['#actions'][$i]['#title']),
+              'amount' => $discount,
+              'weight' => $predicate['#actions'][$i]['#settings']['line_item_weight'],
+            );
+            $id++;
+          }
         }
       }
     }

