Thanks, I used your code and also mixed it in with the Ajax Attribute Calculations Module so that the prices are updated dynamicly and the discount price is displayed, not just in the cart, but also on the product view.
Here's the first part of the Calculate_Price() function with my (few) changes:
function _calculate_price() {
drupal_set_header("Content-Type: plain/text; charset=utf-8");
$field_values = $_POST;
$correct_token = drupal_get_token($field_values['uccp']['field_id']);
$nid = $field_values['uccp']['nid'];
if ($correct_token == $field_values['uccp']['form_token']) {
$result = db_query('SELECT sell_price, list_price FROM {uc_products} WHERE nid=%d AND vid=(SELECT vid FROM {node} WHERE nid=%d)', $nid, $nid);
if ($product = db_fetch_object($result)) {
global $user;
if(in_array("discount user", $user->roles)){
$price = $product->list_price;
}else{
$price = $product->sell_price;
}
//$price = $product->sell_price;
}



Joined: 03/07/2008