uc_userpoints_product module does not add points correctly
| Project: | Ubercart Userpoints |
| Version: | 5.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
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.

#1
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 productthe .= 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.
#2
Automatically closed -- issue fixed for 2 weeks with no activity.