=== modified file 'uc_product/uc_product.module'
--- uc_product/uc_product.module	2009-01-30 21:55:39 +0000
+++ uc_product/uc_product.module	2009-02-02 21:18:33 +0000
@@ -510,7 +510,7 @@
     '#type' => 'textfield',
     '#title' => t('Sell price'),
     '#required' => TRUE,
-    '#default_value' => $node->sell_price,
+    '#default_value' => $node->value,
     '#description' => t('Customer purchase price.'),
     '#weight' => 2,
     '#size' => 20,
@@ -694,8 +694,16 @@
 /**
  * Implementation of hook_load().
  */
-function uc_product_load(&$node) {
-  return db_fetch_object(db_query('SELECT model, list_price, cost, sell_price, weight, weight_units, length, width, height, length_units, pkg_qty, default_qty, unique_hash, ordering, shippable FROM {uc_products} WHERE vid = %d', $node->vid));
+function uc_product_load($node) {
+  $product =  db_fetch_object(db_query('SELECT model, list_price, cost, sell_price, weight, weight_units, length, width, height, length_units, pkg_qty, default_qty, unique_hash, ordering, shippable FROM {uc_products} WHERE vid = %d', $node->vid));
+  // Preserve the original product value before the product is altered.
+  $value = $product->sell_price;
+
+  drupal_alter('product', $product, $node);
+
+  $product->value = $value;
+
+  return $product;
 }
 
 /**
@@ -740,7 +748,7 @@
       '#weight' => $weight['image'],
     );
   }
-  $node->content['display_price'] = array('#value' => theme('uc_product_display_price', $node->sell_price, $teaser, $page),
+  $node->content['display_price'] = array('#value' => theme('uc_product_price', $node->sell_price, 'display-price', $teaser, $page),
     '#access' => $enabled['display_price'],
     '#weight' => $weight['display_price'],
   );
@@ -750,7 +758,7 @@
       '#weight' => $weight['model'],
     );
     $node->content['body']['#weight'] = 1;
-    $node->content['list_price'] = array('#value' => theme('uc_product_price', $node->list_price, 'list_price', $teaser, $page),
+    $node->content['list_price'] = array('#value' => theme('uc_product_price', $node->list_price, 'list-price', $teaser, $page),
       '#access' => $enabled['list_price'],
       '#weight' => $weight['list_price'],
     );
@@ -763,7 +771,7 @@
     $node->content['#attributes'] = array('style' => 'display: inline');
   }
 
-  $node->content['sell_price'] = array('#value' => theme('uc_product_sell_price', $node->sell_price, $teaser, $page),
+  $node->content['sell_price'] = array('#value' => theme('uc_product_price', $node->sell_price, 'sell-price', $teaser, $page),
     '#access' => $enabled['sell_price'],
     '#weight' => $weight['sell_price'],
   );
@@ -955,6 +963,7 @@
     $tokens['list_price'] = $object->list_price;
     $tokens['cost'] = $object->cost;
     $tokens['sell_price'] = $object->sell_price;
+    $tokens['value'] = $object->value;
     $tokens['weight_units'] = $object->weight_units;
     $tokens['weight-raw'] = $object->weight;
     $tokens['weight'] = uc_weight_format($object->weight, $object->weight_units);
@@ -976,6 +985,7 @@
     $tokens['product']['list_price'] = t("The product's list price.");
     $tokens['product']['cost'] = t("The product's cost.");
     $tokens['product']['sell_price'] = t("The product's sell price.");
+    $tokens['product']['value'] = t("The original value of the product, before price adjustments.");
     $tokens['product']['weight_units'] = t("The unit of measurement for the product's weight.");
     $tokens['product']['weight-raw'] = t("The numerical value of the product's weight.");
     $tokens['product']['weight'] = t("The product's formatted weight.");
@@ -1219,7 +1229,7 @@
       '#cell_attributes' => array('width' => '100%'),
     );
     $data['list_price'] = array('#value' => uc_currency_format($node->list_price), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
-    $data['price'] = array('#value' => theme('uc_product_sell_price', $node->sell_price, TRUE), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
+    $data['price'] = array('#value' => theme('uc_product_price', $node->sell_price, 'sell-price', TRUE), '#cell_attriubtes' => array('nowrap' => 'nowrap'));
     if (module_exists('uc_cart') && arg(0) != 'admin') {
       $data['add_to_cart'] = array('#value' => drupal_get_form('uc_catalog_buy_it_now_form_'. $node->nid, $node));
     }
@@ -1368,43 +1378,25 @@
  */
 function theme_uc_product_price($price, $class, $teaser = 0, $page = 0) {
   $output = '<div class="'. $class .'">';
-  switch ($class) {
-    case 'list_price':
-      $output .= t('List Price: !price', array('!price' => uc_currency_format($price)));
-    break;
-    case 'cost':
-      $output .= t('Cost: !price', array('!price' => uc_currency_format($price)));
-    break;
-    case 'sell_price':
-    default:
-      $output .= t('Price: !price', array('!price' => uc_currency_format($price)));
-    break;
-  }
-  $output .= '</div>';
-  return $output;
-}
-
-/**
- * Format the selling price based on the view mode.
- *
- * @param $price
- *   The price amount.
- * @param $teaser
- *   Passed from uc_product_view().
- * @ingroup themeable
- */
-function theme_uc_product_sell_price($price, $teaser = 0, $page = 0) {
   if ($teaser) {
-    $output = '<div class="sell-price">';
     $output .= uc_currency_format($price);
-    $output .= '</div>';
   }
   else {
-    $output = '<div class="sell-price">';
-    $output .= t('Price: !price', array('!price' => uc_currency_format($price)));
-    $output .= '</div>';
+    switch ($class) {
+      case 'list-price':
+        $output .= t('List Price: !price', array('!price' => uc_currency_format($price)));
+      break;
+      case 'cost':
+        $output .= t('Cost: !price', array('!price' => uc_currency_format($price)));
+      break;
+      case 'sell-price':
+      default:
+        $output .= t('Price: !price', array('!price' => uc_currency_format($price)));
+      break;
+    }
   }
 
+  $output .= '</div>';
   return $output;
 }
 
@@ -1471,16 +1463,6 @@
   return $output;
 }
 
-/**
- * @ingroup themeable
- */
-function theme_uc_product_display_price($price, $teaser = 0, $page = 0) {
-  $output = '<div class="display-price">';
-  $output .= uc_currency_format($price);
-  $output .= '</div>';
-  return $output;
-}
-
 // Returns an array of product node types.
 function uc_product_types() {
   return module_invoke_all('product_types');


