Hello,
I have gotten the code listed below to work on the product page. I now want this to affect the catalog and product blocks that show a price as well. I am still working on figuring it out and will post back if I solve it.
Thanks in advance guys.
<?php
function userpoints_ubercart_nodeapi(&$node, $op, $arg3, $arg4) {
switch ($op){
case 'view':
//print_r($node);
//die;
if ($node->type=='product') {
$dispStyle = variable_get(USERPOINTS_DISPLAY,2);
//disp 1=dollars, 2=both, 3=points
$pointExchange = intval(variable_get(USERPOINTS_UC_SPEND, 1));
$pointCost = intval(round($node->sell_price) * $pointExchange);
switch($dispStyle) {
case 1:
//do nothing since we only want dollars
//$node->content['sell_price']['#value'] = '$$';
//$node->content['display_price']['#value'] = '$$';
break;
case 2:
$node->content['sell_price']['#value'] .= t('!Points: ' . $pointCost, userpoints_translation());
$node->content['display_price']['#value'] .= '<div class="display_price">' . t('!Points: ' . $pointCost, userpoints_translation()) . '</div>';
break;
case 3:
$node->content['sell_price']['#value'] = t('!Points: ' . $pointCost, userpoints_translation());
$node->content['display_price']['#value'] = '<div class="display_price">' . t('!Points: ' . $pointCost, userpoints_translation()) . '</div>';
break;
}
}
}
}
?>


Joined: 09/24/2007