Closed (fixed)
Project:
Ubercart Userpoints
Version:
5.x-2.2
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2008 at 14:54 UTC
Updated:
16 Nov 2008 at 03:16 UTC
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 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 commentedthe 1.x branch is no being actively maintained at this time. Please switch to the 2.x branch.
Comment #3
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 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 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 commentedshould be fixed in the dev version.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.