<php
/**
* Implementation of hook_nodeapi().
*/
function uc_discounts_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if (variable_get('uc_discounts_product_discount_price', 0) && $op=='view' && in_array($node->type, array_keys(uc_product_node_info()))) {
$product = node_load(array('nid' => $node->nid));
$discount_price = uc_discounts_product_discount_price($product);
$node->content['display_price']['#value'] = '<div class="display_price discount_price">'. uc_currency_format($discount_price) .'</div>';
if (variable_get('uc_discounts_product_full_price', 0) && $discount_price != $product->sell_price) {
$node->content['sell_price']['#value'] = '<div class="sell_price">'. uc_currency_format($discount_price) .' <div class="discount">('. t('discounted from') .' '. uc_currency_format($product->sell_price) .')</div></div>';
}
else {
$node->content['sell_price']['#value'] = '<div class="sell_price discount_price">'. uc_currency_format($discount_price) .'</div>';
}
}
}
?>I just add a class to discounted price for better styling. If somebody want to hightlight it for example. Now it can be done with css.
