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

rszrama’s picture

Project: UC Userpoints Discount » Ubercart Userpoints
Version: 5.x-1.0 » 5.x-1.x-dev

I'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.

bmagistro’s picture

Status: Active » Closed (fixed)

the 1.x branch is no being actively maintained at this time. Please switch to the 2.x branch.

rszrama’s picture

Version: 5.x-1.x-dev » 5.x-2.2
Status: Closed (fixed) » Active

I 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.

bmagistro’s picture

Hello,

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.

leenwebb’s picture

I 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!)

bmagistro’s picture

Status: Active » Fixed

should be fixed in the dev version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.