Alternative

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

closing the loop:
---

An alternative method I used instead that was pretty painless

http://drupal.org/project/uc_custom_price

in the 'uc_custom_price' textarea you get for the node you're editing

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

The Attribute Tokens module looks like a good way of easily referencing the attributes without magic numbers like [3].. http://www.ubercart.org/contrib/2381

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

Hope this helps someone

Price adjustments by multipliers By: tortoise (44 replies) Mon, 05/05/2008 - 18:40