I have setup userpoints with different taxonomy categories: cat1, cat2, and cat3.

Let's say a user has 100 points in cat1, 50 in cat2, and 200 in cat3.

But they want to purchase a product that is 275 points.

Correct me if I am wrong, but right now this cannot be completed.

I would like to be able to use the category with the most points, then the second most, etc until their is enough points for purchase.

Any idea how to do this?

Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bmagistro’s picture

Status: Active » Postponed

You are correct this is not possible right now. I am not sure what the best way would be but could probably put some stuff together to use any. What happens if you only want them to use a limited number of categories? I am marking this as postponed for now because I would like to get the issues on D6 reduced before I start adding more things.

SocialNicheGuru’s picture

Why not have a list of categories and allow the admin to select which can be included and select the order

yaoweizhen’s picture

Status: Postponed » Needs review

It's easy to do. Looking at this function in userpoints.module:

function userpoints_get_current_points($uid = NULL, $tid = NULL) 

Send 'all' to $tid, it will get points of all categories. So just add "all" option for payment category select box, solved!

yaoweizhen’s picture

But the points are decreased in defautl category.

IWasBornToWin’s picture

Allow the user to allocate which amount they want from each category? Have a calculation which subtracts each amount from the total as they enter it within each category, like;

transaction amount 250

Headings -
category, balance, amount (allocated for current transaction)

cat1, 60, 50(user inputs)
cat2, 300, 150(user inputs)
cat3, 100, 50(user inputs)

Total allocated for this transaction (calculates as user adds amounts in each category)

jstushnoff’s picture

Component: Code » uc_userpoints_discount
Issue summary: View changes
FileSize
19.35 KB

Sorry, I've never contributed code updates before but I've made quite a few changes and thought I'd upload them in case someone wanted to roll a patch from my comments and code changes.