Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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!
Comment | File | Size | Author |
---|---|---|---|
#6 | uc_userpoints_discount-do-not-test.patch | 19.35 KB | jstushnoff |
Comments
Comment #1
bmagistro CreditAttribution: bmagistro commentedYou 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.
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedWhy not have a list of categories and allow the admin to select which can be included and select the order
Comment #3
yaoweizhen CreditAttribution: yaoweizhen commentedIt's easy to do. Looking at this function in userpoints.module:
Send 'all' to $tid, it will get points of all categories. So just add "all" option for payment category select box, solved!
Comment #4
yaoweizhen CreditAttribution: yaoweizhen commentedBut the points are decreased in defautl category.
Comment #5
IWasBornToWin CreditAttribution: IWasBornToWin commentedAllow 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)
Comment #6
jstushnoff CreditAttribution: jstushnoff as a volunteer commentedSorry, 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.