uc_userpoints_product module does not add points correctly on orders with multiple products containing userpoints, when the order is completed.

I created various products with different points values. If I purchased more than one product with different points values assigned to each, the calucation was incorrect and the user was awarded the incorrect number of points.

For example : 5+10 points = 105 points

changed line 95 :

$totalPoints .= ($product->qty * $points); // Make sure we account for multiple qty of the Points product

to the following :

$totalPoints = $totalPoints + ($product->qty * $points); // Make sure we account for multiple qty of the Points product

and now the calucations are done correctly

Many thanks for a great module.

Comments

bmagistro’s picture

Status: Active » Fixed

thanks for pointing that out. I fixed it differently in the dev. The line now reads as

$totalPoints += ($product->qty * $points); // Make sure we account for multiple qty of the Points product

the .= means concatenate which is what it did in your example except it would have been read as 510 (5 + 10). The += as it looks is addition.

Status: Fixed » Closed (fixed)

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