Alternative

timl@drupal.org's picture
Offline
Joined: 03/19/2009
Juice: 10
Alternative

An alternative method I used instead that was pretty painless

http://drupal.org/project/uc_custom_price

and in the custom price window for that product add the following code

$licenses = $item->data['attributes'][3];
if (intval($licenses)){
   $item->price = $item->price*intval($licenses);
   #drupal_set_message("Number of licenses is incorrect, must be anumber ($licenses)","status");
}else{
   drupal_set_message("Number of licenses is incorrect, must be a number ($licenses)","error");
}
#print_r($item);

you may need to put a print_r($item) in the code to see what your $item object looks like

Hope this helps someone

Attribute Price Multiplier By: dkruse@drupal.org (8 replies) Wed, 05/06/2009 - 00:25