No replies
LoveGolf's picture
Offline
Joined: 10/16/2008
Juice: 106
Was this information Helpful?

Hey guys,

I've been an active member around here for awhile and I'm stuck on something. Really I just need some php help.

I'm trying to change the price of 4 different attributes based on the users role.

Below is what I have so far. Notice it's adding $100 to the base price. I'm not sure of how to code up the attribute array.

<?php
global $user;
if (
in_array('authenticated user', $user->roles)) {
 
$item->price = $item->price+1000.00;
}
?>

Below is the format for coding up attributes. I need to combine the two ...

if('[size]' == 'large' && '[color]' == 'black') {
  $item->price += 1;
}

Link to module - http://drupal.org/project/uc_custom_price