--- D:/xampplite/htdocs/vat.69/sites/all/modules/ubercart/uc_store/uc_store.module.2009-02-13.bak	Fri Feb 13 17:42:02 2009
+++ D:/xampplite/htdocs/vat.69/sites/all/modules/ubercart/uc_store/uc_store.module	Tue Feb 17 20:48:28 2009
@@ -822,6 +822,56 @@
   return $format;
 }
 
+
+/**
+ * Format an amount for display opening the opportunity for contribs to hook in
+ * and e.g. test for CA conditions or change the currency on all prices.
+ * Fallback: If there is no Price Display Handler installed, Item price and Qty are put together again
+ * and uc_currency_format() is returned.
+ * @param $data:
+ *   Object containing for products the Item Price, Qty (defaults to 1), the type, optional $order_id, $cart_id,
+ *   for line_items if available all line_item data + optional $order_id, $cart_id
+ * @param $sign, $thou, $dec are just passed through for uc_currency_format()
+ */
+function uc_display_price($data, $sign = TRUE, $thou = TRUE, $dec = NULL) {
+
+    $output = module_invoke_all('uc_price', $data, $sign, $thou, $dec);
+  if ($output['0']) {
+    return $output['0'];
+  }
+  else {
+    $price = uc_get_price($data);
+    return uc_currency_format($price, $sign, $thou, $dec);
+  }
+}
+
+/**
+ * Fallback function for the US used in uc_display_price().
+ * Filters the amount and quantity both for products as well for line_items and puts the total amount
+ * together again to be displayed through uc_currency_format()
+ */
+function uc_get_price($data){
+  $qty = '1';
+  if ($data->price) {
+    $amount = $data->price;
+    if ($data->qty) {
+      $qty = $data->qty;
+    }
+  }
+  elseif ($data->line_items['amount']) {
+    $amount = $data->line_items['amount'];
+    if ($data->line_items['qty']) {
+      $qty = $data->line_items['qty'];
+    }
+  }
+  // prevents zero values from not updated modules.
+  elseif (is_numeric($data)) {
+    $amount = $data;
+  }
+  $price = $amount * $qty;
+  return $price;
+}
+
 /**
  * Format a weight value for display.
  */
