--- uc_varprice.module.orig     2010-09-12 10:35:01 -0700
+++ uc_varprice.module  2010-09-12 12:09:06 -0700
@@ -19,6 +19,13 @@
 }

 /**
+ * Implementation of hook_theme_registry_alter().
+ */
+function uc_varprice_theme_registry_alter(&$theme_registry) {
+       $theme_registry['uc_price']['function'] = 'uc_varprice_theme_uc_price';
+}
+
+/**
  * Implementation of hook_form_alter().
  *
  * Summary of alterations:
@@ -38,8 +45,8 @@
     }
   }

-  // 2) Alter the add to cart form.
-  if (strpos($form_id, 'uc_product_add_to_cart_form_') === 0) {
+  // 2) Alter the add to cart form/catalog listing form
+  if (strpos($form_id, 'uc_product_add_to_cart_form_') === 0 || strpos($form_id, 'uc_catalog_buy_it_now_form_') === 0) {
     $data = uc_varprice_product_load($form['nid']['#value']);

     if ($data) {
@@ -423,3 +430,12 @@
   return $element['#default_value'];
 }

+// Override theme_uc_price to hide price when using a variable price.
+function uc_varprice_theme_uc_price($value, $context, $options) {
+  // If this is a variable price item, clear value as we never want to display the static value.
+  if (db_result(db_query("SELECT pfid FROM {uc_product_features} WHERE fid = 'varprice' AND nid = %d", $context['subject']['node']->nid))) {   
+    $value = '';
+  }
+  
+  return theme_uc_price($value, $context, $options);
+}
