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.
Line 33 of uc_points_discount.inc reads as follows:
$maxdisc = round($curUserPoints / (int)variable_get(USERPOINTS_UC_SPEND, 1));
Why the rounding? For my store, 100 points = $1, so having 350 points means you get a $3.50 discount, not a $4 one. Obviously, this wasn't a very tricky fix to make in my own code, but if anyone else is using 1pt=$.01, watch out! Beware the tricksy rounding!
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedI'm pretty sure this code is from the Ubercart Userpoints module, as I don't use camel case variables like this. : )
I believe that file is part of the other project as well.
Comment #2
bmagistro CreditAttribution: bmagistro commentedthe 1.x branch is no being actively maintained at this time. Please switch to the 2.x branch.
Comment #3
rszrama CreditAttribution: rszrama commentedI moved this here because it was in the wrong spot, so I specified the 1.x branch. However, a quick glance at the 2.x branch's code shows that you're still rounding like this in uc_userpoints_discount.module line 95.
Comment #4
bmagistro CreditAttribution: bmagistro commentedHello,
I think I did that because the person I developed it for wanted that. I haven't looked at it, but if you have a patch to remove it can I have it? I might make it a configurable option defaulted to off.
Comment #5
leenwebb CreditAttribution: leenwebb commentedI didn't patch it so much as just edit the file... :) I searched for 'round' and deleted it. I think there were only 2 or 3 spots where it was used, so it was a pretty easy change.
(Sorry for posting originally in the wrong place -- I've got too many modules to keep straight, apparently!)
Comment #6
bmagistro CreditAttribution: bmagistro commentedshould be fixed in the dev version.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.