Downloads
Below is a modified version of function theme_uc_product_sell_price($price, $teaser) in uc_product.module that adds a CSS class to the sell_price div on product nodes (and maybe elsewhere?) when the price is $0 so that simple CSS can be optionally used in a theme to not display the price when it's $0, eg div.zero_price { display: none; }
function theme_uc_product_sell_price($price, $teaser) {
$class = 'sell_price';
if ($price == null || $price == 0 || $price=="0.00")
$class .= ' zero_price';
if ($teaser) {
$output = '<span class="'. $class. '">';
$output .= uc_currency_format($price);
$output .= '</span>';
}
else {
$output = '<div class="'. $class. '">';
$output .= t('Price: !price', array('!price' => uc_currency_format($price)));
$output .= '</div>';
}
return $output;
}And for grid catalog display (uc_catalog.module) replace the line:
$product_table .= '<span class="catalog_grid_sell_price">'. uc_currency_format($product->sell_price) .'</span>';with lines:
$sell_price_class = 'catalog_grid_sell_price'. ($product->sell_price == '0.00' ? ' zero_price': '');
$product_table .= '<span class="'. $sell_price_class. '">'. uc_currency_format($product->sell_price) .'</span>';
We have a multi-site install so it made more sense for us to hack core once instead of multiple themes.