Subtract UserPoints from all taxonomy terms upon purchase? OK So i was wondering if someone could point me in the right direction. Currently I'm running User Points Module with UberCart in order to purchase items with currency or use points for purchases. Now i've managed to get the transaction to work as needed except for one small thing. The Ubercart API only allows me to subtract the purchase points from a single category like "General". Id like to subtract the points used to buy the product from ALL the categories the use has points in. Does anybody know a way this can be done?
You have few options that depend on the number of userpoints categories and the way you want to do it (w or w/o code):

Option 1: Create separate actions for each userpoint category within Ubercart.

Option 2: Enter custom PHP code and do the following:


Load userpoints dictionary - userpoints_get_vid()
Loop through all terms in it and subtract the points.  


Sample code:

$userpoints_vid = userpoints_get_vid();
$userpoints_terms = taxonomy_get_tree($userpoints_vid);
foreach ($userpoints_terms as $term) {
  // Build the params for this transaction.
  $params = array(
    'points' =&gt; -100,
    'moderate' =&gt; FALSE,
    'term_id' =&gt; $term-&gt;tid,
    'entity_id' =&gt; $order-&gt;order_id,
    'entity_type' =&gt; 'order',
  );
  // Subtract the points. This will call automatically all UP hooks.
  userpoints_userpointsapi($params);
}


Option 3: You could also create a Rules action from the code above that will accept $order as an argument. This will take slightly more time, but is the right way to do things.